This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: curses.textpad.Textbox(win).edit() won't edit last character
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Dietmar Schindler, ned.deily, twouters
Priority: normal Keywords:

Created on 2016-08-05 13:03 by Dietmar Schindler, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
edit.py Dietmar Schindler, 2016-08-05 13:03
Messages (3)
msg272027 - (view) Author: Dietmar Schindler (Dietmar Schindler) Date: 2016-08-05 13:03
curses.textpad.Textbox(win).edit() does not allow to enter a character (or change one, if already there) at the very last position in a window (the lower right hand corner), though it allows to position the cursor there. This applies to the whole screen as well as other windows (also if the window's right margin isn't the screen margin). A sample program is attached (try to fill the last line completely with some character).
msg272057 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-08-05 20:29
Looks like there have been longstanding issues with using curses to write to the right-/bottom-most character position of a curses window; see open Issue8243 and various discussions elsewhere.  Some of the discussions suggest the issues dates back to support of physical terminals where writing to the last character position caused an automatic scroll up of the lines on a screen and suggest it is best to avoid trying to write in that last position.  I'm not a curses expert so whether that advice is still relevant today and whether Textbox behavior should be changed are open questions.  The behavior could just be added to the proposed documentation changes in Issue8243.  Perhaps @twouters has a suggestion.
msg272223 - (view) Author: Dietmar Schindler (Dietmar Schindler) Date: 2016-08-09 07:31
Regarding Issue8243: This issue is about writing the lower-right character of a window via *addch()* or *addstr()*. But for curses.textpad.Textbox(win).edit() the use of *addch()* or *addstr()* is not unavoidable; it could well use *insch()* or *insstr()* (at the lower-right cell or everywhere), which don't cause the problem of the cursor advancing outside the window. Or, curses.textpad.Textbox(win).edit() could handle the exception caused thereby. It's all in the hands of curses.textpad.Textbox(win).edit()'s implementation, to work as specified.
Besides, even if terminals where writing to the last character position on screen caused an automatic scroll were still relevant, that wouldn't justify impeding the behavior of all other windows (that don't contain the screen's last cell). Just documenting erroneous behavior would, in my opinion, be an unfortunate choice.
History
Date User Action Args
2022-04-11 14:58:34adminsetgithub: 71880
2016-08-09 07:31:03Dietmar Schindlersetmessages: + msg272223
2016-08-05 20:29:39ned.deilysetnosy: + ned.deily, twouters

messages: + msg272057
versions: + Python 3.5, Python 3.6, - Python 3.2
2016-08-05 13:03:06Dietmar Schindlercreate