#[default] in window-status-current-format resets terminal background and drops status bar background colorFile: src/format.zig, src/status.zig, src/colour.zig, src/server/render.zig, src/server/server.zig
Severity: MEDIUM
Status: ✅ FIXED
When setting a custom active window format such as:
set -g window-status-current-format "#[bg=blue,fg=white]#I:#W#[default]"
the active window title rendered with the requested highlight, but all status bar text and background after the active window title (subsequent inactive window entries, padding, right status, and trailing fill spaces) reverted to the terminal emulator’s default background (black / transparent) instead of the configured status-bg.
src/format.zig, #[default] and #[none] directly emitted \x1b[m (ANSI SGR 0 reset). When processed by the terminal emulator, SGR 0 clears all text styling and resets foreground and background to terminal defaults (\x1b[39m / \x1b[49m).format.zig’s Context, status.zig’s buildLine and packLine, and server.zig did not propagate the status bar’s baseline fg and bg (status-fg / status-bg) to format expansion. After #[default] ran in the active window format, the status bar never restored status-bg, causing the remainder of the line to be drawn with the terminal’s default background.#[default] at the end leaked their style attributes into subsequent window entries.DisplayClient cached the rendered status line by width (status_line_width) without tracking whether it was rendered in copy mode (status_line_copy_mode). Exiting copy mode left the yellow copy-mode status line cached in dc.status_line on non-dirty frames.src/colour.zig:
Colour.writeSgr and Colour.appendSgr to generate ANSI SGR escape sequences.appendReset(allocator, out, fg, bg) to reset text attributes via \x1b[m and re-apply non-default baseline fg and bg colors.src/format.zig:
Context with default_fg and default_bg baseline colors.applyStyleAttr and appendColourSgr so that #[default], #[none], #[fg=default], and #[bg=default] restore default_fg and default_bg.#[bold fg=yellow] and #[bold,fg=yellow]).src/status.zig:
fg and bg fields to BuildInput.buildLine and packLine to propagate baseline colors to Context and call appendReset on segment/window boundaries containing escape sequences.src/server/server.zig & src/server/render.zig:
status_fg and status_bg (including copy-mode overrides) into buildStatusLine.status_line_copy_mode in DisplayClient to invalidate the cached status line on copy-mode enter/exit, and marked self.dirty = true on copy-mode transitions.renderStatusBar to reset any leftover SGR state before applying status bar theme colors.