diff --git a/src/ftxui/component/terminal_input_parser.cpp b/src/ftxui/component/terminal_input_parser.cpp index d3f2d6a..f19d6ad 100644 --- a/src/ftxui/component/terminal_input_parser.cpp +++ b/src/ftxui/component/terminal_input_parser.cpp @@ -19,6 +19,8 @@ const std::map g_uniformize = {{ // See https://github.com/ArthurSonzogni/FTXUI/issues/337 // Here, we uniformize the new line character to `\n`. {"\r", "\n"}, + // See: https://github.com/ArthurSonzogni/FTXUI/issues/508 + {std::string({8}), std::string({127})}, }}; TerminalInputParser::TerminalInputParser(Sender out) diff --git a/src/ftxui/component/terminal_input_parser_test.cpp b/src/ftxui/component/terminal_input_parser_test.cpp index 922ee19..f0f8163 100644 --- a/src/ftxui/component/terminal_input_parser_test.cpp +++ b/src/ftxui/component/terminal_input_parser_test.cpp @@ -302,7 +302,7 @@ TEST(Event, Control) { }; std::vector cases; for (int i = 0; i < 32; ++i) { - if (i == 13 || i == 24 || i == 26 || i == 27) + if (i == 8 || i == 13 || i == 24 || i == 26 || i == 27) continue; cases.push_back({char(i), false}); } @@ -342,6 +342,8 @@ TEST(Event, Special) { {str("\x1B[A"), Event::ArrowUp}, {str("\x1B[B"), Event::ArrowDown}, {{127}, Event::Backspace}, + // Quirk for: https://github.com/ArthurSonzogni/FTXUI/issues/508 + {{8}, Event::Backspace}, {str("\x1B[3~"), Event::Delete}, //{str("\x1B"), Event::Escape}, {{10}, Event::Return},