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).
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 bpo-8243 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 bpo-8243. Perhaps @twouters has a suggestion.
DietmarSchindler commented on Aug 9, 2016
DietmarSchindlermannequin
MannequinAuthor
More actions
Regarding bpo-8243: 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.
Fixed in PR #152363: the lower-right cell is now written with insch(), which fills it without moving the cursor out of the window (the addch() that the cursor-advance would trigger raises an error and scrolls a scrollable window).
Activity
DietmarSchindler commented on Aug 5, 2016
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).
ned-deily commented on Aug 5, 2016
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 bpo-8243 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 bpo-8243. Perhaps @twouters has a suggestion.
DietmarSchindler commented on Aug 9, 2016
Regarding bpo-8243: 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.
gh-71880: Allow editing the last cell in curses.textpad.Textbox (GH-1…
[3.14] gh-71880: Allow editing the last cell in curses.textpad.Textbox (
[3.13] gh-71880: Allow editing the last cell in curses.textpad.Textbox (
serhiy-storchaka commented on Jun 27, 2026
Fixed in PR #152363: the lower-right cell is now written with insch(), which fills it without moving the cursor out of the window (the addch() that the cursor-advance would trigger raises an error and scrolls a scrollable window).
[3.15] gh-71880: Allow editing the last cell in curses.textpad.Textbox (