From 72e4e43b1fc1743dc3e9dae70682f2945eeba45d Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sat, 11 Apr 2026 06:08:38 +0800 Subject: feat: implement URL navigation and input handling in browser TUI --- src/tui/terminal.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/tui') diff --git a/src/tui/terminal.cc b/src/tui/terminal.cc index 75c6c1f..9e78a02 100644 --- a/src/tui/terminal.cc +++ b/src/tui/terminal.cc @@ -74,4 +74,16 @@ std::pair Terminal::get_size() // NOLINT(readability-c return { static_cast( w.ws_col ), static_cast( w.ws_row ) }; } +void Terminal::move_cursor( std::size_t row, std::size_t col ) const // NOLINT +{ + // ANSI: \x1b[H move to 1,1; \x1b[row;colH move to specified row and column + std::cout << "\x1b[" << row << ";" << col << "H"; +} + +void Terminal::show_cursor( bool visible ) const // NOLINT +{ + // \x1b[?25h show cursor, \x1b[?25l hide cursor + std::cout << ( visible ? "\x1b[?25h" : "\x1b[?25l" ); +} + } // namespace ricochet::tui \ No newline at end of file -- cgit v1.2.3