Severity: HIGH
Status: Fixed
Between v0.8.2 and v0.9.0, multiple interacting regressions broke window-status-format and window-status-current-format configuration, live runtime option updates, and real-time status line redraws.
set -g (Commit ba666087f669 / Bug #415)In options.zig, window-status-format and window-status-current-format are defined in WINDOW_OPTIONS, whereas global_options holds SESSION_OPTIONS.
When parsing set -g window-status-format "..." in szn.conf, the directive is parsed with flags.global = true and flags.window = false.
if (s.flags.window) {
self.global_window_options.set(s.option, s.value) catch |err| {
std.log.warn("set window option {s} failed: {any}", .{ s.option, err });
};
} else if (s.flags.session or s.flags.server or s.flags.global) {
self.global_options.set(s.option, s.value) catch |err| {
std.log.warn("set session/global option {s} failed: {any}", .{ s.option, err });
};
}
Because s.flags.global is matched in the else if branch without checking if the option belongs to global_window_options, self.global_options.set() fails with error.UnknownOption and the setting is dropped.
Similarly, in cmd.zig:927-937 (cmdSetOption):
if (is_global) {
if (is_window) {
server.global_window_options.set(option_name, parsed_val) catch return .err;
} else {
server.global_options.set(option_name, parsed_val) catch return .err;
}
}
Passing set -g window-status-format ... without -w fails directly with .err.
23cbd6eeaca4 / Bug #425)Commit 23cbd6eeaca4 introduced status_dirty caching in renderToDisplayClient():
const use_cache = !self.status_dirty and dc.status_line_width == dc.sx and dc.status_line != null and dc.status_line_copy_mode == pane_in_copy_mode and dc.status_line_time == current_sec;
self.status_dirty = true was only set in tickStatusInterval() on periodic timer ticks.next-window, prev-window, select-window), window lifecycle events (new-window, kill-window, rename-window), and set-option only set server.dirty = true without setting server.status_dirty = true.use_cache evaluated to true, causing the status bar to display the old cached line with outdated window active states and flags (*).src/cfg.zigIn cfg.zig:156-177, stripInlineComment() only recognized double quotes ("). If a user specified single-quoted format strings (e.g. set -g window-status-format '#I:#W') or unquoted #I:#W, the parser treated # as an inline comment and truncated the string.
buildStatusLineIn server.zig:478-486, buildStatusLine() retrieved win_fmt only from the currently active window and passed it globally to all windows in buildLine(), ignoring per-window formats set on inactive windows.
truncateVisible vs visibleLen Wide Character Discrepancy (Commit 65a952c4f3af / Bug #432)status.zig:114-124 measured character cell width with char_width.charWidth(cp), while status.zig:172 (truncateVisible) incremented single columns (cols += 1). Wide characters or emoji in window formats resulted in mismatched truncation and alignment calculations.
| Commit | Changeset | Description |
|---|---|---|
| 659 | ba666087f669 |
fix(cfg,server): handle combined short options, scope flag routing, set-environment and if-shell (bug #415) |
| 668 | 23cbd6eeaca4 |
perf(server): key status cache on timestamp + status_dirty and use O(1) client lookup (bug #425) |
| 683 | 65a952c4f3af |
fix(status): measure wide and combining character cell widths in visibleLen (bug #432) |
applyDirectives(), when -g is given without explicit -s or -w, option lookup tries global_options first; if error.UnknownOption is returned, it falls back to global_window_options.cmdSetOption(), option lookup falls back between session and window options for both global (-g) and active session targets.setw, set-window-option, and set-option directives in cfg.zig and registered set-window-option / setw command entry in cmd.zig.server.status_dirty = true across all window navigation and lifecycle actions (next_window, prev_window, last_window, select_window_*, new_window, kill_window, rename_window, mouse tab click) and whenever setting options starting with status or window-status.stripInlineComment() and parseValue() in cfg.zig to support single-quoted format strings '#I:#W', preserving embedded # format characters without stripping them as comments.format and current_format fields to WindowInfo and resolved templates per-window in buildStatusLine() and buildLine().truncateVisible() in status.zig to decode codepoints and measure cell widths with char_width.charWidth(), matching visibleLen() and preventing mid-cell splits on wide characters / emojis.