Skip to content

Run the live activity display full screen on interactive terminals - #34

Open
Koenocta wants to merge 2 commits into
arendvw:mainfrom
Octatube:fix/live-display-full-screen
Open

Koenocta wants to merge 2 commits into
arendvw:mainfrom
Octatube:fix/live-display-full-screen

Conversation

@Koenocta

Copy link
Copy Markdown
Contributor

Bugs

Seen in a build tool that uses CliTracker on Windows Terminal (PowerShell 7):

  1. The screen is not reset. The live display renders inline with AutoClear(false). A second CliTracker in the same process (e.g. a "stage" tracker followed by a "publish" tracker) starts a new live area below the first one; old frames stay in the scrollback and you can scroll up into them.
  2. The height jumps. The content-height layout makes the panes only part of the window high, and they grow as content arrives.
  3. Clipped logs and broken borders. The status and log columns split the width evenly, so long log lines (multi-line scripts, pages of psql output) are clipped, and after resizing the window the panel borders get cut off on the left because nothing redraws on resize.

Fix

On an interactive ANSI terminal (Ansi && Interactive && Profile.Out.IsTerminal) the display now runs full screen:

  • It switches to the alternate screen buffer (ESC[?1049h), clears it and hides the cursor, and fills the whole window. When it stops it switches back (ESC[?1049l) and writes the final state to the normal screen once, so the result stays visible and each tracker leaves exactly one copy behind. A second tracker starts on a clean screen. A ProcessExit handler restores the normal screen if the process exits while the display is up.
  • Every frame positions each line explicitly (ESC[row;1H), so neither line-break handling nor a full last line can scroll the screen. The refresh loop compares Profile.Width/Height with the previous frame and clears and redraws on resize.
  • Column sizing: the status column gets the width its table needs (measured, at most 3/5 of the window, and only growing during a run so the columns don't shift as progress messages change); the log pane gets the rest.
  • Log lines wrap to the pane width instead of being clipped, and only the newest lines that fit are rendered.
  • It runs under RunExclusive, like Spectre's own live display, so a prompt during the display fails as before instead of being hidden. Other writes to the console while it runs are captured by a render hook, shown in the log pane, and written to the normal screen before the final state, so nothing is lost in the alternate screen.

Redirected output (CI logs, files) and consoles without ANSI support keep the inline Spectre live display, now with the same column sizing and wrapping.

Small extra: log timestamps use HH:mm:ss instead of the 12-hour hh:mm:ss.

Public API

Additive only (minor version):

  • CliTracker.FullScreen { get; init; } (default true)
  • LiveActivityRenderer.FullScreen { get; set; } (default true)

Setting it to false keeps the inline display. docs/guide.md describes the behaviour and the opt-out.

Testing

dotnet build Terminator.sln and dotnet test --solution Terminator.sln pass on net8.0, net9.0 and net10.0 (168 tests). New tests in LiveActivityRendererTests:

  • the full-screen frame is exactly the console width and height, even with little content
  • the status column takes what its table needs and leaves the rest to the log; a very long progress message is capped so the log keeps room
  • long log lines wrap instead of being clipped; with many lines only the newest that fit are shown, filling the pane
  • full screen is only used on an interactive ANSI terminal; redirected output and FullScreen = false stay inline
  • a run enters and leaves the alternate screen and writes the final state after leaving; a second run starts with a fresh, cleared screen and does not repeat the first run's steps
  • a resize clears the screen and redraws at the new size
  • output written during the display shows in the log pane and is written to the normal screen before the final state

The existing inline tests from #31 still pass unchanged. The visual behaviour in a real terminal (Windows Terminal, resize, scrollback) was not checked by hand yet.

🤖 Generated with Claude Code

Koenocta and others added 2 commits November 13, 2026 08:02
The live display rendered inline with a height that followed its content:
a second CliTracker in the same process started a new live area below the
first, old frames stayed in the scrollback, the panes were often only part
of the window high and grew as content arrived, the columns split the width
evenly so long log lines were clipped, and a resized window left cut-off
borders behind.

On an interactive ANSI terminal the display now uses the alternate screen
buffer and fills the whole window. Every frame positions each line
explicitly, and the screen is cleared and redrawn when the window size
changes. The status column gets the width its table needs (at most three
fifths, only growing during a run so the columns don't shift), the log pane
the rest; log lines wrap to the pane width and only the newest lines that
fit are kept. Output written to the console meanwhile is captured, shown in
the log pane and written to the normal screen afterwards. When the display
stops it restores the normal screen and writes the final state there once,
so each tracker leaves exactly one result behind.

Redirected output and consoles without ANSI support keep the inline
display, now with the same column sizing and wrapping.

New: CliTracker.FullScreen and LiveActivityRenderer.FullScreen (default
true) to opt out of the full-screen display.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On GitHub Actions the default profile enrichers set Interactive to false,
so the full-screen tests saw a non-interactive console and failed there only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant