Files
CodeWhale Bot df0921ebb8 feat(tui): /fullscreen and /inline switch the screen at runtime
The alternate screen was a startup-only bool that `tui.alternate_screen =
"never"` parsed and ignored. `ScreenMode` (Fullscreen | Inline) is now the
one source of truth: `App` stores it and derives `use_alt_screen()`, so every
pause/resume/teardown site reads the screen the terminal is actually on.

- `/fullscreen` keeps the alternate screen (still the default); `/inline`
  paints a stock ratatui `Viewport::Inline` the full height of the terminal
  with no alternate screen, so the shell's scrollback survives the session
  and stays scrollable after exit.
- `tui.alternate_screen = "never"` starts inline; `auto`/`always` keep the
  old meaning.
- The switch rebuilds the terminal over a backend that carries every
  negotiated fact (colour depth, palette, theme, measured background) and
  adopts it only once `Terminal::with_options` succeeded. A probe the
  terminal refuses rolls the alternate-screen escape back and says why.
- The cleanup guard and panic path read the live screen through
  `live_alt_screen()`, not the startup choice.
- Inline mode paints the whole transcript inside its viewport; nothing is
  committed to host scrollback yet (documented in docs/CONFIGURATION.md).

Evidence:
  cargo test -p codewhale-tui --lib -- screen_mode screen_commands startup_screen config_never commands::tests
    test result: ok. 91 passed; 0 failed; 0 ignored
  scripts/dev-test.sh tui
    Summary [ 154.810s] 11856 tests run: 11856 passed (1 slow, 2 leaky), 13 skipped
  cargo test -p codewhale-tui --test cucumber --features long-running-tests -- screen_mode_inline_pty
    test result: ok. 1 passed; 0 failed (real PTY: DEC 1049 never set on inline start; /fullscreen sets it, /inline clears it)
Signed-off-by: CodeWhale Bot <bot@codewhale.net>
2026-09-01 18:17:30 -07:00
..