diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-06-19 14:07:58 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-06-19 14:07:58 +0200 |
| commit | b198d40e35050c8692296f06acedfaf5e3c8a023 (patch) | |
| tree | 1bfb0142b148dccca0723feb2e4642a8aed32f96 /ttwhy/routers/echo.cppm | |
| parent | 324af400623a336eb74f51360822d134cad97537 (diff) | |
| download | ttwhy-b198d40e35050c8692296f06acedfaf5e3c8a023.tar.xz ttwhy-b198d40e35050c8692296f06acedfaf5e3c8a023.zip | |
lib/io: extend scanner
Diffstat (limited to 'ttwhy/routers/echo.cppm')
| -rw-r--r-- | ttwhy/routers/echo.cppm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ttwhy/routers/echo.cppm b/ttwhy/routers/echo.cppm index 41b7b51..fb392d6 100644 --- a/ttwhy/routers/echo.cppm +++ b/ttwhy/routers/echo.cppm @@ -15,6 +15,8 @@ namespace ttwhy::routers using namespace std::string_view_literals; constexpr auto vte_backspace_sequence = "\b \b"sv; + constexpr auto vte_newline_sequence = "\r\n"sv; + constexpr auto vte_horizontal_tab_sequqnce = "\t"sv; export template<typename StreamType> struct echo @@ -59,9 +61,18 @@ namespace ttwhy::routers co_await asio::async_write(m_output_stream, asio::buffer(vte_backspace_sequence), asio::as_tuple(asio::use_awaitable)); break; + case control_key::enter: + co_await asio::async_write(m_output_stream, asio::buffer(vte_newline_sequence), + asio::as_tuple(asio::use_awaitable)); + break; + case control_key::tab: + co_await asio::async_write(m_output_stream, asio::buffer(vte_horizontal_tab_sequqnce), + asio::as_tuple(asio::use_awaitable)); + break; default: co_await asio::async_write(m_output_stream, asio::buffer(std::format("{{CTRL:{}}}", std::to_underlying(key))), asio::as_tuple(asio::use_awaitable)); + break; }; } |
