Repository navigation
curses.textpad.Textbox(win).edit() won't edit last character #71880
Description
Activity
DietmarSchindler commented
on Aug 5, 2016 DietmarSchindlermannequinMannequinAuthorMore actionscurses.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).
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
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 DietmarSchindlermannequinMannequinAuthorMore actionsRegarding 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.- added 3 commits that reference this issue
on Jun 27, 2026 - added3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixes
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 (theaddch()that the cursor-advance would trigger raises an error and scrolls a scrollable window).- added a commit that references this issue
on Jun 27, 2026
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs