Skip to content

Respect user tmux option overrides in status bar config#330

Merged
asheshgoplani merged 5 commits intoasheshgoplani:mainfrom
johnuopini:feat/respect-tmux-option-overrides
Mar 17, 2026
Merged

Respect user tmux option overrides in status bar config#330
asheshgoplani merged 5 commits intoasheshgoplani:mainfrom
johnuopini:feat/respect-tmux-option-overrides

Conversation

@johnuopini
Copy link
Contributor

Summary

  • When users define tmux options via [tmux] options that match agent-deck's managed status bar keys (status, status-style, status-left-length, status-right, status-right-length), agent-deck now skips its default for that key instead of silently overwriting it
  • Extracted buildStatusBarArgs() from ConfigureStatusBar() to separate pure logic from subprocess execution, enabling unit testing
  • Documented override behavior in the config template with a practical example (options = { "status" = "2" })

Motivation

Agent-deck's ConfigureStatusBar() hardcodes 5 tmux options per-session, applied on every session create/activate/focus change. Users who set these options via [tmux] options in config.toml had their values immediately overwritten — making it impossible to customize the status bar (e.g. multi-line status with status = "2") while keeping agent-deck's notification bar.

Approach

buildStatusBarArgs() builds the tmux command dynamically. For each of the 5 managed defaults, it checks s.OptionOverrides — if the user defined that key, it's skipped. Fully backward compatible: empty/nil options map produces identical behavior to the original code.

Test plan

  • No overrides — all 5 defaults applied
  • Empty overrides map — all defaults applied
  • Single key override — that key skipped, others applied
  • Multiple key overrides — those keys skipped
  • Unrelated override (e.g. history-limit) — all defaults applied
  • All 5 managed keys overridden — returns nil, no tmux call
  • inject_status_line = false — returns nil (unchanged behavior)
  • Full test suite passes with no regressions

johnuopini added a commit to johnuopini/agent-deck that referenced this pull request Mar 13, 2026
Includes PR asheshgoplani#330 status bar override fix.
johnuopini added a commit to johnuopini/agent-deck that referenced this pull request Mar 15, 2026
Includes PR asheshgoplani#330 status bar override fix.
Verify that status bar configuration respects user-defined tmux
options by skipping managed defaults when overrides are present.
Extract buildStatusBarArgs from ConfigureStatusBar and skip any
managed default whose key appears in OptionOverrides, so user-defined
[tmux] options take precedence over agent-deck defaults.
Covers the nil-return path when all 5 managed status bar keys
are present in OptionOverrides.
When sessions are loaded from storage via ReconnectSessionLazy,
OptionOverrides was never populated. This caused EnsureConfigured ->
ConfigureStatusBar to ignore user overrides (e.g. status = "2") and
unconditionally set status = "on", clobbering multi-line status bars.

The Start() paths already set OptionOverrides via buildTmuxOptionOverrides(),
but the reconnect path in loadInstancesFromDB was missing it.
@johnuopini johnuopini force-pushed the feat/respect-tmux-option-overrides branch from 3d20cd0 to 19550f8 Compare March 17, 2026 08:27
johnuopini added a commit to johnuopini/agent-deck that referenced this pull request Mar 17, 2026
Includes PR asheshgoplani#330 status bar override fix.
@asheshgoplani asheshgoplani merged commit 31b0e8b into asheshgoplani:main Mar 17, 2026
@johnuopini johnuopini deleted the feat/respect-tmux-option-overrides branch March 17, 2026 14:26
@asheshgoplani asheshgoplani mentioned this pull request Mar 18, 2026
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.

2 participants