fix(tmux): do not configure a tmux that is not installed - #59
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
install.shno longer links tmux config or clones tmux plugins when tmux is notinstalled. 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_tmuxstill returns empty-handed on a non-x86_64 host, on a downloadfailure, or when the AppImage neither runs nor extracts. On any of those, v1.13.1
still links
.tmux.conf,.tmux.conf.localandtmux-status-rows, and theworkstation profile still clones plugins.
install_zshalready did this correctly - it returns early with an actionablewarning - so this is
install_tmuxmatching an existing, proven pattern ratherthan a new convention.
I looked for this deliberately:
tests/no-fixture-masking.py(1.13.1) states in itsown 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.shchains them:install_tmux's early return must exit 0, orset -ewould kill the wholeinstall - which means
&&proceeds and_install_tmux_pluginsstill runs. Guardingonly 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:
Red-proof - identical scenario with v1.13.1's
modules/tmux.shrestored:The plugin guard was exercised separately and directly (sourcing the module and
calling
_install_tmux_pluginswith tmux absent), because only the workstationprofile reaches it and the container run above used
minimal- so that run is notevidence for it:
Also:
test.sh workstation62/63, 0 failures;tests/no-fixture-masking.pyPASSED;tests/lint-workflows.shPASSED; 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.