Files
pipelines/app/third_party/xterm

xterm (vendored)

This is our maintained copy of xterm.dart, vendored from the pub.dev release 4.0.0 (MIT, see LICENSE; the upstream README is kept as UPSTREAM_README.md). Upstream is unmaintained, so the app depends on this directory through a path dependency and we patch it here.

The commit that added this directory is the pristine upstream copy; every later change is a local patch. Review them with git log -p -- app/third_party/xterm.

Tests for the patches live in the app tree, app/test/third_party_xterm/, so they run under the memory watchdog with the rest of the app tests. The app's analysis_options.yaml excludes this directory from its strict lints; the code still compiles as part of every app build.

Local patches (keep this list current):

  • CSI parsing: colon subparameters (4:3, 38:2::r:g:b, 58/59), intermediates and private prefixes (CSI > 4;2 m is not SGR), empty parameters as defaults; SGR 21 is double underline, 53/55 overline
  • DCS/APC/PM/SOS strings consumed rather than printed; DECRQSS (m, r, q) answered
  • RIS (ESC c) full reset and DECSTR (CSI ! p)
  • DECSCUSR cursor shapes (blinking is stored; the host animates it); SCOSC/SCORC, CHT, CBT, HPA, HPR, VPR; HTS sets tab stops; DSR 6 one-based
  • OSC 10/11/12 colour queries from the view's theme; OSC 8 links on cells (Terminal.hyperlinkAt); OSC 52 set (onClipboardSet, no reads); OSC 7 (onWorkingDirectoryChange)
  • alternate screen 1049 restores the cursor; arrow keys follow DECCKM
  • mouse: wheel 64/65, screen-cell coordinates, drag (1002) and motion (1003) reporting, middle button, Shift+drag selects (ui/mouse_listener.dart)
  • rendering: block cursor shows the character inverted, underline/bar cursor position, strikethrough, conceal, overline, underline styles
  • focus reporting (?1004, Terminal.focusInput, called by TerminalView)
  • Terminal.maxLines is settable (Buffer.setMaxLines): a smaller value drops the oldest scrollback at once; IndexAwareCircularBuffer.trimStart detaches the dropped lines and keeps the others' indexes (it left them attached and off by the trimmed count, so clearScrollback broke anchors)
  • TerminalView.cursorBlinkVisible: the host animates a blinking cursor; while false the render object skips the cursor (the painter is unchanged)
  • RenderTerminal is exported from ui.dart (cell geometry for hosts)