Skip to content

curses.textpad.Textbox backspace support #60436

Closed

Description

@emeaudroidemeaudroid
BPO 16232
Nosy @ned-deily

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:

assignee = None
closed_at = None
created_at = <Date 2012-10-14.14:38:05.797>
labels = ['extension-modules', 'easy', 'type-feature']
title = 'curses.textpad.Textbox backtrace support'
updated_at = <Date 2019-03-15.22:29:17.594>
user = 'https://bugs.python.org/emeaudroidemeaudroid'

bugs.python.org fields:

activity = <Date 2019-03-15.22:29:17.594>
actor = 'BreamoreBoy'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Extension Modules']
creation = <Date 2012-10-14.14:38:05.797>
creator = 'emeaudroid.emeaudroid'
dependencies = []
files = []
hgrepos = []
issue_num = 16232
keywords = ['easy']
message_count = 3.0
messages = ['172888', '223108', '237423']
nosy_count = 3.0
nosy_names = ['ned.deily', 'emeaudroid.emeaudroid', 'ragreener']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'test needed'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue16232'
versions = ['Python 3.5']

Linked PRs

Activity

  1. emeaudroidemeaudroid commented on Oct 14, 2012

    emeaudroidemeaudroidmannequin
    MannequinAuthor

    python: 2.6.6
    curses' revision: 61064 2008-02-25 16:29:58Z andrew.kuchling

    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 ?

  2. BreamoreBoy commented on Jul 15, 2014

    BreamoreBoymannequin
    Mannequin

    @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.

  3. ned-deily commented on Mar 7, 2015

    @ned-deily
    Member

    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.

  4. transferred this issue fromon Apr 10, 2022
  5. ProfDeSI commented on Nov 4, 2022

    @ProfDeSI

    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 Textbox (I use Thonny on a Mac) and it seems that I have stumbled upon a deep rooted issue. Since the previous message is seven years old, am I right if I say that this bug was forgotten and never fixed ?

  6. k3lseytaylor commented on Dec 30, 2022

    @k3lseytaylor

    Also running this issue (Iterm2 on Mac)
    Textbox backspace is not registering and can only delete using Ctrl + H

  7. aidanmelen commented on Apr 6, 2023

    @aidanmelen
    Contributor

    @k3lseytaylor I ran into the same issue. Maybe this example will help.

  8. mblahay commented on Apr 24, 2023

    @mblahay
    Contributor

    @ProfDeSI @k3lseytaylor @aidanmelen

    I am attempting to reproduce this issue, but not having any success. Please confirm which version of Python you are using.

  9. aidanmelen commented on Apr 24, 2023

    @aidanmelen
    Contributor

    @mblahay i think this issue is specific for macOS and python:3.11-alpine docker image.

  10. mblahay commented on Apr 24, 2023

    @mblahay
    Contributor

    @aidanmelen Do you see the issue when outside of docker?

  11. aidanmelen commented on Apr 24, 2023

    @aidanmelen
    Contributor

    @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 curses.ascii.DEL key presses in addition to curses.KEY_BACKSPACE.

  12. aidanmelen commented on Apr 24, 2023

    @aidanmelen
    Contributor

    I created a PR that fixes this issue.

  13. mblahay commented on Apr 24, 2023

    @mblahay
    Contributor

    @aidanmelen, I must be doing something different from you. What version of MacOS are you using?

  14. zitterbewegung commented on Apr 24, 2023

    @zitterbewegung
    Contributor

    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.

  15. mblahay commented on Apr 25, 2023

    @mblahay
    Contributor

    @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.

  16. added a commit that references this issue on Apr 26, 2023
  17. changed the title [-]curses.textpad.Textbox backtrace support[/-] [+]curses.textpad.Textbox backspace support[/+] on Apr 26, 2023
  18. ambv commented on Apr 26, 2023

    @ambv
    Contributor

    Fixed in Python 3.12. Thanks Michael for reviving this, and thanks Aidan for the fix! ✨ 🍰 ✨

  19. moved this from Features to Done in Curses issueson Apr 26, 2023
  20. mblahay commented on Apr 26, 2023

    @mblahay
    Contributor

    Glad I was able to help coordinate this during Pycon US 2023 sprints. Sometimes things work better in person!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions