Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ftxui/component/terminal_input_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ const std::map<std::string, std::string> g_uniformize = {
{"\x1BOH", "\x1B[H"}, // HOME
{"\x1BOF", "\x1B[F"}, // END

// Common Home/End sequences from terminals and multiplexers.
{"\x1B[1~", "\x1B[H"}, // HOME
{"\x1B[4~", "\x1B[F"}, // END

// Variations around the FN keys.
// Internally, we are using:
// vt220, xterm-vt200, xterm-xf86-v44, xterm-new, mgt, screen
Expand Down
4 changes: 4 additions & 0 deletions src/ftxui/component/terminal_input_parser_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ TEST(Event, Special) {
{str("\x1BOH"), Event::Home},
{str("\x1BOF"), Event::End},

// Home/End variants.
{str("\x1B[1~"), Event::Home},
{str("\x1B[4~"), Event::End},

// Backspace & Quirk for:
// https://github.com/ArthurSonzogni/FTXUI/issues/508
{{127}, Event::Backspace},
Expand Down