drivers: Terminal drivers

driversR Documentation

Terminal drivers

Description

A driver is the only part of termr that talks to the terminal. It switches the terminal into application mode (raw input, alternate screen, hidden cursor), writes output, reports the terminal size and turns input into Events. Everything above the driver is pure R and can be tested without a terminal.

Details

  • PosixDriver: Linux, macOS and other Unix terminals (stty raw mode, input read from ⁠/dev/tty⁠).

  • WindowsDriver: Windows consoles and Windows Terminal (a small PowerShell helper reads key events).

  • HeadlessDriver: no terminal at all; output goes to a virtual terminal and input is fed programmatically. Used by test_app().

run() picks the right driver with default_driver().


termr documentation built on Oct. 21, 2026, 5:13 p.m.