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

how does ctrl+backspace work? #517

Open
simonLeary42 opened this issue Oct 8, 2024 · 1 comment
Open

how does ctrl+backspace work? #517

simonLeary42 opened this issue Oct 8, 2024 · 1 comment
Labels
question Question / Mis-usage

Comments

@simonLeary42
Copy link

I notice that when the "complete" menu is open, and I've hovered over an item using arrow keys, ctrl+backspace will delete that item from my input line. In other times, ctrl+backspace deletes the entire input line, and in others, it deletes a seemingly-arbitrary suffix from my input line. Is this behavior documented?

@akinomyoga
Copy link
Owner

It depends on what your terminal actually sends when you press Control+BackSpace. It largely depends on the terminal, as described in §3.1.1. Please read §3.1.1. Some terminals send C-h, some send C-?, some send C-BS (using the advanced keyboard protocol), some send C-w, and some send C-_. To check the code that your terminal sends, you can check the result of the following commands:

$ ble/debug/keylog#start
$       # <-- Please press Control+BackSpace here.
$ ble/debug/keylog#end

If your terminal sends C-BS, it performs delete-backward-cword as listed in §4.4. If there is a selected region (the text region highlighted for some reason), it deletes the selected region. When menu-complete is active (i.e., when you hover over an item in the menu), the temporarily inserted item on the command line is the selected region, so C-BS will delete the inserted item. Otherwise, it deletes the cword as in the widget name. The cword means a consecutive sequence of letters (a-zA-Z), digits (0-9), and underscores (_), or a sequence of other non-space characters.

@akinomyoga akinomyoga added the question Question / Mis-usage label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question / Mis-usage
Projects
None yet
Development

No branches or pull requests

2 participants