Skip to content

Add opt-in multi-line real-time build status display - #2798

Draft
orgads wants to merge 1 commit into
ninja-build:masterfrom
orgads:multi
Draft

Add opt-in multi-line real-time build status display#2798
orgads wants to merge 1 commit into
ninja-build:masterfrom
orgads:multi

Conversation

@orgads

@orgads orgads commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Add an opt-in -m status mode that shows currently running edges in a multi-line real-time status area on ANSI-capable terminals, while preserving the existing single-line output when the flag is not used.

Each status line shows the edge sequence number, description, and elapsed time. The multiline display is capped to the terminal height and 8 rows, and its width is clamped to 60 columns. Long job titles are trimmed from the left so the right side remains visible.

The last finished edge is kept as a temporary line above the active status block, overwritten by the next completion. Error output and command output are printed cleanly after clearing the status area.

Key changes:

  • Add -m to enable multiline status explicitly.
  • Keep default output unchanged when -m is not given.
  • Add 100ms timeout to ppoll/pselect/IOCP so DoWork() returns periodically and refreshes status via Report().
  • Detect terminal dimensions to cap status lines at min(rows - 1, 8).
  • Clamp multiline width to 60 columns and trim long titles from the left.
  • Track each edge's start order via Edge::sequence_ for per-line numbering.
  • Overwrite the display block in place to reduce flicker.
  • Show ... and N more when running edges exceed the display limit.

Fixes #111.

Add an opt-in `-m` status mode that shows currently running edges in a
multi-line real-time status area on ANSI-capable terminals, while
preserving the existing single-line output when the flag is not used.

Each status line shows the edge sequence number, description, and
elapsed time. The multiline display is capped to the terminal height and
8 rows, and its width is clamped to 60 columns. Long job titles are
trimmed from the left so the right side remains visible.

The last finished edge is kept as a temporary line above the active
status block, overwritten by the next completion. Error output and
command output are printed cleanly after clearing the status area.

Key changes:
- Add `-m` to enable multiline status explicitly.
- Keep default output unchanged when `-m` is not given.
- Add 100ms timeout to ppoll/pselect/IOCP so DoWork() returns
  periodically and refreshes status via Report().
- Detect terminal dimensions to cap status lines at min(rows - 1, 8).
- Clamp multiline width to 60 columns and trim long titles from the left.
- Track each edge's start order via Edge::sequence_ for per-line
  numbering.
- Overwrite the display block in place to reduce flicker.
- Show `... and N more` when running edges exceed the display limit.

Fixes ninja-build#111.
@orgads

orgads commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

It is very slow on Windows. I'll see if I can improve it. Changing to draft for now.

@orgads
orgads marked this pull request as draft June 14, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant