Expand description
Streaming command execution (TTY scrolling area / prefixed lines / logger fallback).
Ported from internal/executor/exec_streamed.go. Uses the same
tokio::process::Command + background-runtime bridge as exec::run
(see exec::runtime). chooseStreamer’s three-way fan-out is ported as
choose_streamer/Streamer: a scrolling area (TTY +
use_scrolling_area), prefixed lines (TTY, no scrolling area), or the
tracing-based logger fallback (no TTY) used by every existing test in
this module (stderr isn’t a terminal under cargo test).
Go renders with pterm (ANSI styling) directly. This port uses
anstyle for the SGR codes and writes through anstream’s
auto-detecting stream wrapper, which strips styling when stdout/stderr
isn’t a terminal or NO_COLOR is set – matching this project’s
terminal-accessibility requirements without each call site needing its
own NO_COLOR check.
Structs§
- Area
Printer - A port of
pterm.AreaPrinter: an in-place, self-redrawing block of terminal lines (not a full alternate-screen TUI –ptermitself is a terminal-formatting library, not a TUI framework, so cursor-up-and- overwrite via raw ANSI escapes is the faithful equivalent, matching whatpterm.AreaPrinterdoes internally). - Exec
Streamed Opts - Ported from
ExecStreamedOpts.
Functions§
- exec_
streamed_ command - Ported from the package-level
execStreamedCommandfunction. - flush_
lines_ to_ area - Ported from
flushLinesToArea. - is_
stderr_ tty - Ported from
isStderrTTY. - truncate_
line - Ported from
truncateLine. - wrap_
line - Ported from
wrapLine. - write_
prefixed_ lines_ filtered - Ported from
writePrefixedLinesFiltered.tuimirrors*logfilter.TUI; seecrate::logfilterfor its port status.