- Packages:
@flowtty/tty-backend, @flowtty/inline-tty-backend, render() in @flowtty/react — v1.0.0-alpha.11
- Area: robustness outside an interactive terminal
TtyBackend assumes it is talking to a capable, interactive terminal and never checks. Each item below was reproduced with a five-line app (render(<Text color="red" bold>hello</Text>, new TtyBackend())).
Observed
Not checked yet
Expected — to decide per item, roughly
- Non-TTY stdout: either refuse with a clear error, or degrade to a plain, final-frame text dump without control sequences (a
render option; the inline backend's printStatic path is close to this already).
- Honor
NO_COLOR (drop color SGR, keep bold/dim/underline) and FORCE_COLOR.
TERM=dumb: treat like a non-TTY.
- Restore the terminal on
SIGTERM / SIGHUP / SIGINT, then re-raise, so the exit status is still the signal's.
- A README section stating what happens in each of these cases.
Value: clear. This is the class of failure a user meets on day one — a garbled CI log, a terminal stuck in the alt screen — and none of it needs new features.
@flowtty/tty-backend,@flowtty/inline-tty-backend,render()in@flowtty/react—v1.0.0-alpha.11TtyBackendassumes it is talking to a capable, interactive terminal and never checks. Each item below was reproduced with a five-line app (render(<Text color="red" bold>hello</Text>, new TtyBackend())).Observed
mycli | tee log, CI, a file): the alt-screen and cursor sequences and every SGR code are written into the pipe — the log starts withESC[?1049h ESC[?25l ESC[2J ESC[H …. Nothing in the backend looks atstdout.isTTY(only stdin's, for raw mode).NO_COLOR=1is ignored:ESC[1;31mis still emitted.TERM=dumbis ignored: the alt screen is still entered.SIGTERM/SIGHUP: the process dies with the terminal left in the alt screen and the cursor hidden — neitherESC[?1049lnorESC[?25his written. Only Ctrl-C / Ctrl-D (read as keys in raw mode) and uncaught errors restore it;render()installs no signal handlers. Same for bracketed paste and mouse reporting, which stay switched on.Not checked yet
stdinis not a TTY while stdout is (input piped in):onKeysilently never fires.rgb()/#hexare always emitted as 24-bit SGR, with no 256-color or 16-color downgrade.Expected — to decide per item, roughly
renderoption; the inline backend'sprintStaticpath is close to this already).NO_COLOR(drop color SGR, keep bold/dim/underline) andFORCE_COLOR.TERM=dumb: treat like a non-TTY.SIGTERM/SIGHUP/SIGINT, then re-raise, so the exit status is still the signal's.Value: clear. This is the class of failure a user meets on day one — a garbled CI log, a terminal stuck in the alt screen — and none of it needs new features.