UvTerminalRenderer constructor

UvTerminalRenderer(
  1. StringSink _writer, {
  2. List<String>? env,
  3. bool? isTty,
  4. bool isWindows = false,
})

Creates a terminal renderer writing to _writer.

Optional env provides environment variables for capability detection. Set isTty to force TTY mode when the sink is not a real terminal.

Implementation

UvTerminalRenderer(
  this._writer, {
  List<String>? env,
  bool? isTty,
  bool isWindows = false,
}) : _isWindows = isWindows,
     _env = env ?? const [],
     _term = Environ(env ?? const []).getenv('TERM'),
     _caps = _xtermCaps(Environ(env ?? const []).getenv('TERM')) {
  _cur = _Cursor(x: -1, y: -1);
  _saved = _cur.clone();
  _profile = _detectProfile(_env, isTty, isWindows);
  _screen = _RendererScreen(this);
  final environ = Environ(_env);
  _isTmuxSession =
      environ.getenv('TMUX').isNotEmpty ||
      environ.getenv('TERM').startsWith('tmux');
}