Closed radlinskii closed 1 year ago
Hi, can I work on this?
Sure 👍
I was able to get alt+backspace
working but on windows and linux the shortcut to delete last word is ctrl+backspace
. It looks like crossterm gives ctrl+h
(konsole, alacritty) or ctrl+w
(VSCode terminal) when ctrl+backspace
is pressed. We can probably detect those keys and delete the last word.
Using PushKeyboardEnhancementFlags
seems to give the correct event but it only works on terminals which support the kitty keyboard protocol
We can probably use PushKeyboardEnhancementFlags
for terminals that support it(using crossterm::terminal::supports_keyboard_enhancement
and use ctrl+h
and ctrl+w
if it is not supported. Does that sound good?
Perfect 👌
On MacOS it makes a lot of sense to have
<Alt>+<Backspace>
deleting characters from current cursor position till beginning of the word (till white space character). It might be easier to type a word again if there were any mistakes in it.