1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

Shell: Start adding some alt shortcuts

This adds Alt-f to go forward by a word, and Alt-b to go backward
by a word (like ctrl-arrow-left / ctrl-arrow-right already do).

Behind the scenes, alt-key is implemented by sending <esc> followed
by that key, and typing <esc> f/b for moving by a word hence works
too (in all other shells too, not just in Serenity's).

While here, rename some InputState enum values to make the slightly
expanded use of <esc> clearer, and expand a few comments.
This commit is contained in:
Nico Weber 2020-08-06 10:52:18 -04:00 committed by Andreas Kling
parent 471083ca3d
commit 4d9d054386
2 changed files with 26 additions and 17 deletions

View file

@ -377,8 +377,8 @@ private:
enum class InputState {
Free,
ExpectBracket,
ExpectFinal,
GotEscape,
GotEscapeFollowedByLeftBracket,
ExpectTerminator,
};
InputState m_state { InputState::Free };