The interactive TUI should show how long the current top-level turn has been running. The indicator appears on the right side of the live status line while a turn is active and updates live so long-running work has an immediate time signal.
TuiScreen projection that the
controller owns.ZCODE_ environment variable or alter provider/runtime contracts.The controller is the source of truth for whether a turn is active. It sets
activeTurnStartedAtMs when a prompt is accepted and clears it in the same
cleanup path that clears busy, abortController, and activeTurnId.
The Ink renderer may use component-local timer state to refresh the displayed duration. That timer is presentation-only: it must not own session state, call providers, read storage, or perform external I/O. The timer must be cleaned up when the indicator unmounts and should be unref'd when the runtime supports it.
The status line should keep the live status text on the left, such as
Streaming model response..., and right-align the elapsed indicator in the same
row. The elapsed label must truncate to terminal width and must not overlap the
prompt, network panel, session panel, or status details.
Elapsed formatting must use larger units for longer turns: milliseconds below a
second, seconds below a minute, Xm YYs after a minute, and Xh YYm ZZs after
an hour.
Elapsed time is computed with Node's standard timers and wall-clock milliseconds. The implementation must not depend on shell commands, POSIX signals, terminal escape parsing outside the existing Ink renderer, or platform-specific time formatting.
If the turn aborts or the TUI closes, the controller clears the active timestamp and the renderer timer is disposed with the component. If the clock moves backward, the display clamps elapsed time to zero rather than showing a negative duration.
The TUI test suite should cover: