-
-
Notifications
You must be signed in to change notification settings - Fork 32k
curses.textpad.Textbox backspace support #60436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
python: 2.6.6 line 93 and 102 of curses/textpad.py could you replace the backspace's specific chars codes by using this dedicated curses' function retrieving the currently in-use char's code ? ord( curses.erasechar( )) this one would make specific erase char specified to term supported, unlike curses.ascii.BS, curses.KEY_BACKSPACE that are specifics to most configurations indeed. at least adding the curses.ascii.DEL char's code seems legit na ? |
@emeaudroid please accept our apologies for the delay in getting back to you. Can someone take a look at this please as I don't have a *nix box to play with. |
This has also been reported in bpo-23598 including a patch to add DEL as suggested. I have little experience with curses so I don't have any insight as to pros and cons of using erasechar() rather than the hardcoded BS and DEL chars. A test would be nice if someone has a creative approach for creating one. I see that a patch for bpo-13051 contains a suggested test for another problem with curses.textpad; perhaps it could be adapted. |
Hello there, I am digging up this discussion because I am starting to use curses and I can't erase the text I type inside a |
Also running this issue (Iterm2 on Mac) |
@k3lseytaylor I ran into the same issue. Maybe this example will help. |
@ProfDeSI @k3lseytaylor @aidanmelen I am attempting to reproduce this issue, but not having any success. Please confirm which version of Python you are using. |
@mblahay i think this issue is specific for macOS and |
@aidanmelen Do you see the issue when outside of docker? |
It does not work in either of those environments. It only works on Mac when we handle |
I created a PR that fixes this issue. |
@aidanmelen, I must be doing something different from you. What version of MacOS are you using? |
I helped @mblahay reproduce this on an M1 Mac using macOS 13.3.1 and in a terminal using ncurses and delete was working fine . In textedit delete and backspace is working. |
@aidanmelen We were finally able to reproduce this issue. Our problem with reproduction stemmed from our using the wrong example. When we use the example in your pull request, we also see the issue on macs (verified on three different machines). For those that are following along, the problem can be seen when running the Lib/curses/textpad.py module file as a script. It should produce a square that you can type into (and delete from!). The fix you provided does appear to work, and as far as we can tell does not cause any negative affects on Linux/Windows. |
Co-authored-by: Łukasz Langa <[email protected]> Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Michael Blahay <[email protected]>
Fixed in Python 3.12. Thanks Michael for reviving this, and thanks Aidan for the fix! ✨ 🍰 ✨ |
Glad I was able to help coordinate this during Pycon US 2023 sprints. Sometimes things work better in person! |
Uh oh!
There was an error while loading. Please reload this page.
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
The text was updated successfully, but these errors were encountered: