-
Notifications
You must be signed in to change notification settings - Fork 297
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
Convert CTRL+Backspace to CTRL+? #2231
base: master
Are you sure you want to change the base?
Conversation
When you click CTRL+Backspace, terminal emulators sometimes convert the key-press to CTRL+H, CTRL+W, CTRL+?, Esc seq, TTY. Default is set to "none", therefore using default VTE settings and nothing changes unless you manually change it. I recommend CTRL+W. Ctrl + Breakspace Merge multiple vte.feedChild into one. Ctrl+W / H / ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If one offers an option for Ctrl+Backspace to send ESC [ 3 ~
(delete
), ESC [ 3 ; 5 ~
(C-delete
) could also be supported as an option. In addition, there are other terminal keyboard protocols to properly represent Ctrl+Backspace:
- In xterm's modifyOtherKeys, Ctrl+Backspace may be represented as
ESC [ 2 7 ; 5 ; 1 2 7 ~
(C-DEL
) orESC [ 2 7 ; 5 ; 8 ~
(C-BS
) depending on the implementation. - In the kitty keyboard protocol, Ctrl+Backspace is represented as
ESC [ 1 2 7 ; 5 u
(C-DEL
). Technically,ESC [ 8 ; 5 u
(C-BS
) is also a possible sequence.
case SETTINGS_PROFILE_CTRL_BACKSPACE_VALUES[3]: // ^? | ||
vte.feedChild("\u001F"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\u001F
is not ^?
. \u001F
is ^_
, and ^?
is \u007F
(i.e., ASCII DEL
).
edit: I think I knew a terminal that sends \u001F
(i.e., ^_
, ASCII US
) for Ctrl+Backspace in the past, but I cannot recall which terminal it was. As for the terminal application side, GNU Emacs and Readline treat ^_
as "undo", which is useful when accessible from Ctrl+Backspace.
case SETTINGS_PROFILE_CTRL_BACKSPACE_VALUES[4]: // DEL | ||
vte.feedChild("\u0007"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\u0007
is not DEL
. \u0007
is BEL
. I've never seen a terminal sending BEL
for a keypress of Ctrl-Backspace.
@@ -749,6 +760,10 @@ | |||
<default>'narrow'</default> | |||
<summary>Whether ambiguous-width characters are narrow or wide when using UTF-8 encoding</summary> | |||
</key> | |||
<key name="ctrl-backspace" enum="com.gexperts.Tilix.EraseControl"> | |||
<default>'none'</default> | |||
<summary>Makes the terminal threat "Control+Backspace" as different control instead of "Backspace". May be used as a shortcut for removing deleting a word instead of a character.</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"threat" should be a typo of "treat". "removing deleting" should also be a typo.
case SETTINGS_PROFILE_CTRL_BACKSPACE_VALUES[5]: // ESC [ 3 ~ | ||
vte.feedChild("\u001B\u005B\u0033\u007E"); | ||
return true; | ||
case SETTINGS_PROFILE_CTRL_BACKSPACE_VALUES[6]: // DEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be some mismatching. SETTINGS_PROFILE_CTRL_BACKSPACE_VALUES[6]
is "TTY"
.
<value nick='ascii-backspace' value='4'/> | ||
<value nick='ascii-delete' value='5'/> | ||
<value nick='delete-sequence' value='6'/> | ||
<value nick='tty' value='7'/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tty" doesn't seem to be handled anywhere.
When you click CTRL+Backspace, terminal emulators sometimes convert the key-press to CTRL+H, CTRL+W, CTRL+?, Esc seq, TTY. Default is set to "none", therefore using default VTE settings and nothing changes unless you manually change it. I recommend CTRL+W.
#1348 #1498 🎉