Skip to content

fix(tmux): do not configure a tmux that is not installed - #59

Merged
YASoftwareDev merged 1 commit into
masterfrom
fix/tmux-config-guard
Sep 19, 2026
Merged

YASoftwareDev merged 1 commit into
masterfrom
fix/tmux-config-guard

Conversation

@YASoftwareDev

Copy link
Copy Markdown
Owner

What

install.sh no longer links tmux config or clones tmux plugins when tmux is not
installed. It used to do both unconditionally.

Why this is the tail of the no-sudo gap, not a new idea

The original bug was never "tmux is missing" - it was the repo configuring a tmux
that was not there
, so a host looked set up while nothing could use it. 1.12.0
added the installer, which fixes the common case. It does not fix the shape.

_install_tmux still returns empty-handed on a non-x86_64 host, on a download
failure, or when the AppImage neither runs nor extracts. On any of those, v1.13.1
still links .tmux.conf, .tmux.conf.local and tmux-status-rows, and the
workstation profile still clones plugins.

install_zsh already did this correctly - it returns early with an actionable
warning - so this is install_tmux matching an existing, proven pattern rather
than a new convention.

I looked for this deliberately: tests/no-fixture-masking.py (1.13.1) states in its
own output that it cannot see "ships config for a tool it never installs", so I went
looking for live instances of that class by hand. zsh and git were the other
candidates. git is a genuine bootstrap prerequisite (you cannot clone the repo
without it) and zsh was already handled correctly - verified in a container, it
skips cleanly and tells the user to re-run. tmux was the only real one left.

Both entry points are guarded, and that mattered

install.sh chains them:

source modules/tmux.sh && install_tmux && _install_tmux_plugins

install_tmux's early return must exit 0, or set -e would kill the whole
install - which means && proceeds and _install_tmux_plugins still runs. Guarding
only the first function would have cloned plugins for an absent tmux. Caught while
testing the fix, not after shipping it.

Verified

Containers with the AppImage URL pointed at a dead host, so tmux genuinely cannot be
obtained:

! tmux: download failed - skipping
! tmux not found - skipping tmux config and plugins
!   Install tmux, then re-run: bash /home/nosudoer/dotfiles/install.sh
rc=0
~/.tmux.conf: No such file or directory
~/.tmux/plugins: No such file or directory

Red-proof - identical scenario with v1.13.1's modules/tmux.sh restored:

~/.tmux.conf -> /home/nosudoer/dotfiles/tmux/.tmux.conf     # linked, no tmux present

The plugin guard was exercised separately and directly (sourcing the module and
calling _install_tmux_plugins with tmux absent), because only the workstation
profile reaches it and the container run above used minimal - so that run is not
evidence for it:

tmux present: NO
! tmux not found - skipping tmux plugins
rc=0
plugins dir: No such file or directory

Also: test.sh workstation 62/63, 0 failures; tests/no-fixture-masking.py PASSED;
tests/lint-workflows.sh PASSED; shellcheck clean.

Not claimed

This fixes the instance. The general property - "every config the repo ships is
either installed or declared a prerequisite" - is still not mechanized, and I found
this one by reading, not by a check. A guard for that would need to map shipped
configs to the tools they configure, which is judgment-heavy enough that I would
rather say it is unguarded than pretend otherwise.

install_tmux linked .tmux.conf, .tmux.conf.local and tmux-status-rows, and
the workstation profile cloned tmux plugins, with no check that tmux exists.
That is the incoherence behind the original no-sudo gap: the host looked
configured while nothing could use it.

_install_tmux covers the common cases since 1.12.0, but it still returns
empty-handed on a non-x86_64 host, on a download failure, or when the
AppImage neither runs nor extracts. This makes those outcomes honest instead
of silently half-configured, matching install_zsh, which already did it right.

Both entry points are guarded, not just the first: install.sh chains
`install_tmux && _install_tmux_plugins`, and the early return has to exit 0
or `set -e` would kill the install - so the chained call would otherwise
still clone plugins for an absent tmux. Found while testing the fix, not
after shipping it.

Verified in containers with the AppImage URL pointed at a dead host, so tmux
genuinely cannot be obtained: install completes rc=0, ~/.tmux.conf is NOT
linked, no plugins dir, and the log reads "tmux: download failed - skipping"
then "tmux not found - skipping tmux config and plugins". Red-proofed against
v1.13.1's module in the same scenario, which DID link ~/.tmux.conf. The
plugin guard was exercised directly, since only the workstation profile
reaches it.
@YASoftwareDev
YASoftwareDev merged commit 099b176 into master Sep 19, 2026
30 checks passed
@YASoftwareDev
YASoftwareDev deleted the fix/tmux-config-guard branch September 19, 2026 21:21
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