tmux: install the plugin set non-interactively (install-040-plugins.sh) #1

Merged jesse.austin merged 1 commit into ops:main from ops:tmux-plugins-install-040 1 day ago
@jesse.austin jesse.austin commented 1 day ago

bootstrap.sh --all leaves a fresh clone short of converged. install-030-tpm.sh clones the plugin manager, but the plugins themselves wait on an interactive prefix + I that a just-cloned machine has no way to have run.

The failure is quiet rather than loud, which is what makes it worth fixing. Nothing errors -- tmux starts, the config parses, every installer reports OK. But tmux-yank is absent, so clipboard copy silently does nothing, and #{prefix_highlight} in status-right renders as an empty string, so the status bar just looks half-built. It reads as "the team config is broken", not "a step is pending" -- exactly the independent-research detour this repo exists to prevent.

This came out of a real fresh-clone install where the reported symptom was "tmux is not working properly". Everything in the toolkit had in fact installed correctly.

What this adds

install-040-plugins.sh drives TPM's own bin/install_plugins, the supported non-interactive entry point. prefix + I is unchanged and is still how you pick up plugins added mid-session.

It follows the pack contract:

  • numbered with a gap after 030, picked up by the existing install-[0-9]*.sh glob with no orchestrator change
  • sources lib/lib-install.sh, honours TOOLKIT_DRY_RUN
  • no-ops loudly on a converged machine
  • preconditions (tmux, git, TPM, ~/.tmux.conf) exit 2 naming the component to run first; a failed download exits 1
  • ASCII + LF, mode 644, header states purpose / mutations / usage / exit codes

Two details worth a reviewer's eye:

  1. The plugin set is read from the @plugin lines in files/tmux.conf (authoritative per plugins.list). TPM instead reads the live ~/.tmux.conf, so the script warns when that is not our symlink and the installed set would differ.
  2. Documented side effect: TPM resolves its plugin path via tmux start-server \; show-environment, so running this starts a tmux server if none is running. Existing sessions are not modified.

Verification

On Ubuntu 24.04 / tmux 3.4:

  • converged no-op, both normal and dry-run
  • dry-run with tmux-yank removed: previews the clone, changes nothing on disk
  • real run: restores it, post-check confirms every declared plugin present
  • all three exit-2 preconditions (TPM absent, config absent, and a non-toolkit ~/.tmux.conf taking the warn path)
  • full bootstrap.sh --all and --dry-run --all end to end
  • bash -n clean, repo non-ASCII grep clean (shellcheck is not installed on the test box, so it has not been linted)

Notes for review

The README rationale bullet is written to match the "debate welcome, change via PR" framing. If the team would rather keep plugin installation opt-in, the alternative is leaving 030 as-is and documenting bin/install_plugins in the pack README instead -- happy to cut it back to that.

Generated with Claude Code

@jesse.austin jesse.austin referenced the pull request 1 day ago

tmux: install the plugin set non-interactively (install-040-plugins.sh)

@jesse.austin jesse.austin merged commit 74f7025 into main from tmux-plugins-install-040 1 day ago
@jesse.austin jesse.austin closed this pull request 1 day ago
@jesse.austin jesse.austin deleted the tmux-plugins-install-040 branch 1 day ago
Labels

Priority
No priority
Milestone
No milestone
Assignee
No one assigned
1 participant
@jesse.austin