bloznelis / typioca

Cozy typing speed tester in terminal
MIT License
748 stars 20 forks source link

Feature request: Ctrl+Backspace to delete whole words #68

Open DorianRudolph opened 2 years ago

DorianRudolph commented 2 years ago

Ctrl+Backspace is supported in most text entry fields and also other typing trainers such as monkeytype.

bloznelis commented 2 years ago

We support this behavior in terminal'esque fashion – with ctrl+w keystroke.

That being said, handling delete/backspace in terminals is a known problem, as there is no standard way. More info here and here.

Although, I think most modern terminal emulators map ctrl+backspace keystroke to ctrl+h, so we could add the "delete-previous-word" binding on that. But for example, xterm has this reversed – it sends ctrl+h on backspace press and backspace on ctrl+backspace keystroke.. So in order to allow xterm users to use backspace properly we perform simple delete on ctrl+h -> code.

One way to solve this would be to add a configuration menu and have this [ctrl+h deletes a word] behavior on by default, but allow users to disable it.