Skip to content
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

Backspace does not remove a character and is instead included as a byte #9

Open
avuserow opened this issue Aug 23, 2020 · 1 comment

Comments

@avuserow
Copy link

It looks like getpass does not understand keys like backspace:

raku -e'use Terminal::Getpass; say getpass().ords'
# input, replace <BS> by hitting the backspace key: abc<BS><BS><BS>def
# output: (97 98 99 127 127 100 101 102)
# expected: (100 101 102)

Terminal::Readsecret handles this correctly:

raku -e'use Terminal::Readsecret; say getsecret("Password: ").ords'
# input, replace <BS> by hitting the backspace key: abc<BS><BS><BS>def
# output: (100 101 102)

This is on Linux, specifically Fedora 32. I've seen this with xterm and xfce4-terminal.

It would also be nice if ctrl+u was able to delete the whole line and other keys (like arrows) were ignored. I realize that starts getting complex though depending on the terminal mode used.

@titsuki
Copy link
Owner

titsuki commented Nov 24, 2020

@avuserow Thanks for your comment and sorry for my late reply.
I've solved the backspace issue since version 0.0.8.

It would also be nice if ctrl+u was able to delete the whole line and other keys (like arrows) were ignored.

Thanks for your advice! I'll try to solve these issues in the future version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants