-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
In Atuin UI interprets backspace as literal ^h #1753
Comments
I was actually wondering if this behavior of ignoring Ctrl in unprocessed Ctrl+Letter is intended or not. As for the backspace key, there are variations among terminals about how the backspace key is transmitted in the terminal-to-application stream. Some terminals use C-? ( edit: |
Thanks for the info 🙏, first of all. |
I tested atuin in the kitty terminal emulator and it works fine there. |
I think so.
Thanks for the information. |
It's not an easy thing, I think. I temporarily resolved this with: XTerm.VT100.Translations: #override\n\
<KeyPress> BackSpace: string(0x7f) in my UPDATE: The solution for XTerm is far from ideal for several reasons (e.g., it breaks recent versions of Vim etc.) so I would beg for fixing it in UPDATE 2: It seems that on my system the issue can be resolved with: XTerm.VT100.backarrowKey: false
XTerm.VT100.backarrowKeyIsErase: false Perhaps it helps somebody too... |
I'm on Kali Linux 2024.1 I have same problem with backspace being replaced by 'h' and Ctrl+h working as backspace |
Ideally, this kind of handling should be resolved at the lower level of An easy solution is to assign the same feature to all of C-h, C-?, backspace, and C-backspace, whose representations are mixed with one another depending on the terminal. (P.S. This is actually the solution |
We are currently assigning different features to backspace and C-backspace. atuin/atuin/src/command/client/search/interactive.rs Lines 375 to 381 in 8e9e7b9
Depending on the terminal, they might be swapped. That is, edit: The upstream edit2: There is a PR that solves the issue in crossterm-rs/crossterm#506. However, it seems to be blocked because of the terminal dependency. |
In the conventional terminal protocol, Backspace can be transmitted as the code \x08 or \x7F depending on the terminal. Ctrl+Backspace can also be transmitted as the code \x08 or \x7F. These overlap with the code for Ctrl+H and Ctrl+?. The crossterm library does not try to handle these terminal dependencies (probably because it is hard to resolve it perfectly). To provide a consistent experience among terminals, we assign to C-h and C-? the same feature as backspace. Note: The crossterm seems to produce Ctrl+Backspace only in the extended keyboard protocol, so we can trust crossterm particularly for Ctrl+Backspace. For this reason, we keep the feature of removing a backward word by Ctrl+Backspace. atuinsh#1753
…#1857) In the conventional terminal protocol, Backspace can be transmitted as the code \x08 or \x7F depending on the terminal. Ctrl+Backspace can also be transmitted as the code \x08 or \x7F. These overlap with the code for Ctrl+H and Ctrl+?. The crossterm library does not try to handle these terminal dependencies (probably because it is hard to resolve it perfectly). To provide a consistent experience among terminals, we assign to C-h and C-? the same feature as backspace. Note: The crossterm seems to produce Ctrl+Backspace only in the extended keyboard protocol, so we can trust crossterm particularly for Ctrl+Backspace. For this reason, we keep the feature of removing a backward word by Ctrl+Backspace. #1753
Opening the Atuin UI and pressing the backspace key writes an h to the input. To delete the previous character I need to press ctrl+backspace.
I assume it has to do with backspace,
^H
, being interpreted as the literal^H
in some way, hence why ctrl "cancels out" the^
.I can reproduce in:
OS: Arch linux
Atuin version: 18.0.1
The text was updated successfully, but these errors were encountered: