Bash uses readline, and readline can remove the word to the right of the cursor with "kill-word".
The problem is recognizing the control-delete key press. When I click them on bash, "5 ~" is displayed. I could just attach to this, but that would mean that one day I need to type “5 ~” and instead it will delete the word on the right! Therefore, I would rather find the correct control sequence.
I have googled and quite a few resources discuss the delete key, but none of them I found discuss the control-delete key. I experimented with many options, but nothing works.
The worst is the hours I spent on this tedious, pointless shredding, when it really should be a problem.
EDIT: via X, so maybe there is a solution with xev and xmodmap
On my machine, pressing Ctrl-V, Ctrl-Delete displays this:
^[[3;5~
The control character ^[can be replaced with \ e, so you can use bind like this for bash (e.g. in ~/.bashrc):
^[
~/.bashrc
bind '"\e[3;5~":kill-word'
Or you can add the following to your own ~/.inputrcso that Ctrl-Delete does kill-word in any program that uses readline:
~/.inputrc
"\e[3;5~": kill-word
This will only bind the Ctrl-Delete key, you do not need to worry about what happens if you need to enter 5 ~.
, , . <ESC>5~ - . Ctrl-V Ctrl-Delete. Ctrl-V " ".
<ESC>5~
, <ESC>5~, .
^ Q ^ V ( Control-Q, Control-V, ), Control-Delete, ? , , , Putty, . , Linux .
readline , , . , ^ Q ^ V (, , quoted-insert).
, ^ Q ^ V, Delete ( ), readline ^[[3~. , Delete, \e[[3~. , CSI , , readline .
^[[3~
\e[[3~
Alt + D Ctrl + W ( Emacs, )
Ctrl-W .
Ctrl-u .
Emacs (M-w M-u).
Source: https://habr.com/ru/post/1705260/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1705255/add-more-than-16-columns-to-clustered-index&usg=ALkJrhj3-topUDozQ4sEzWAEfSTMfWwBdwExtensibility without Open Source - c #verbose_name_plural неожиданно в модели? - pythonGroup long UTC by day - javaHow to programmatically create a