Skip to content

nativelite-vterm 0.5.4

Choose a tag to compare

@JSBtechnologies JSBtechnologies released this 19 Oct 00:18
· 3 commits to main since this release
v0.5.4
09f8a2f

Added

  • Mouse tracking modes (?1000, ?1002, ?1003, and ?1006 SGR
    encoding): Term::mouse_tracking (MouseTracking::Off/Click/Drag/Motion)
    and Term::mouse_sgr, so a host knows when a program wants the mouse
    reported. Not kept in checkpoints: a restored screen starts with it off.

Changed

  • Plain text is written straight into the screen (ansi::Screen::write_ascii)
    instead of through a scratch buffer of cells. With ansi's lazy row
    clearing and faster UTF-8 decoding, Term::feed on agent output (177x47)
    went from 188 to 330 MiB/s.
  • The ASCII check on text runs is a word-wide is_ascii, since the parser
    never passes controls in text. With ansi's faster text skip, Term::feed
    is now 570 MiB/s on the same workload.
  • Plain ASCII text skips UTF-8 decoding when no character is half-received
    (ansi::Utf8Decoder::is_idle): 570 -> 631 MiB/s.

Added

  • Scrollback: Term::with_history(rows, cols, lines) keeps up to lines
    lines scrolled off the primary screen (ansi::Screen::with_history), read
    through Term::scrollback(). It survives a resize; ESC [3J erases it; the
    alternate screen and scroll regions never add to it. in_alternate_screen()
    tells a host when scrolling back does not apply. Synchronized-output
    snapshots copy the visible rows only.
  • New line mode (LNM, CSI 20 h / CSI 20 l): while set, LF, VT and FF
    also return to column 0. For hosts feeding output from plain pipes, where no
    tty turns LF into CR LF. Kept in checkpoints (flag bit 7; older checkpoints
    restore with it off).

Added

  • Checkpoints: Term::checkpoint() and Term::restore(). A terminal's
    whole state as bytes and back: both screens, cursor, style, scroll region,
    tab stops, saved cursor, modes and a synchronized update in progress.
    Feeding a restored Term the rest of a stream ends in exactly the state of
    one that never stopped — tested at every split point of a stream exercising
    all of that state, and across chunked feeds.
    • Taken only between sequences (Term::can_checkpoint(), via
      ansi::Parser::is_ground()), so the tokenizer never needs saving.
    • Versioned, run-length encoded, and validated on restore: damaged bytes are
      an error (RestoreError), never a panic.
    • Measured (release, i5-12600K): 24x80 full of coloured build output,
      19.7 KB, save 23 us, restore 63 us; 50x200, 42.1 KB, 111 us / 93 us.