nxt/ansi.hpp file

Namespaces

namespace nxt
namespace nxt::ansi

Classes

class nxt::ansi::Writer
ANSI escape sequence builder that writes to a string buffer.
struct nxt::ansi::TerminalGuard
struct nxt::ansi::SynchronizedUpdate
RAII wrapper for terminal synchronized update mode.

Enums

enum class Mode { disabled, debug, enabled }
ANSI output modes.
enum class TerminalColor: int { black = 30, red = 31, green = 32, yellow = 33, blue = 34, magenta = 35, cyan = 36, white = 37, bright_black = 90, bright_red = 91, bright_green = 92, bright_yellow = 93, bright_blue = 94, bright_magenta = 95, bright_cyan = 96, bright_white = 97 }
ANSI 16-color SGR foreground codes.

Functions

void begin_synchronized_update()
void clear_line()
void clear_screen()
void end_synchronized_update()
void hide_cursor()
void init()
auto is_tty() →  bool
Check if stdout is connected to a real TTY.
void move_to(ansi_row_t row, ansi_col_t col)
void move_to(Pos pos)
auto query_cursor_position() →  std::optional<Pos>
auto render_raster(const Raster& raster) →  std::string
void reset_scroll_region()
void scroll_down(height_t n = 1*ln)
void scroll_up(height_t n = 1*ln)
void set_scroll_region(row_t top, row_t bottom)
void show_cursor()

Variables

Mode mode
Current ANSI output mode.