Skip to content

tmux, cmus, and stow fixes from the coder box - #26

Merged
fortes merged 17 commits into
mainfrom
imported-coder-box-changes
Oct 2, 2026
Merged

fortes merged 17 commits into
mainfrom
imported-coder-box-changes

Conversation

@fortes-figma

Copy link
Copy Markdown
Collaborator

Changes made on a coder box that couldn't push to GitHub, plus follow-up fixes from review.

tmux

  • Console popup copies the prefix value itself, not a tmux.prefix-*.conf file, so a prefix like C-Space works there too
  • Fixed the split-binding labels and defined the prefix menu once, as a prefix-menu alias
  • Stopped status-right-style accumulating on reload, and removed a leading comma that added an empty terminal-features entry
  • SSH: the hostname is padded instead of truncated, and terminal titles start with the host
  • Local overrides moved from ~/.tmux.conf.local to ~/.config/tmux/tmux.conf.local; the old file is no longer read

cmus helpers

  • The menu's Stop item now actually stops instead of pausing
  • A track with missing tags no longer breaks the status line or the menu
  • No longer source ~/.profile (the status script ran it on every status refresh)

stow

  • ~/.config/tmux is added to REAL_DIRS, so tmux.conf.local stays out of the repo
  • Unfolds a REAL_DIR that an earlier run folded into the repo, but only for packages in the current run

Lint

  • shfmt formatting across script/
  • shellcheck directives so install_tailscale lints on macOS

After merging, run ./script/stow once on existing machines so ~/.config/tmux becomes a real directory.

🤖 Generated with Claude Code

fortes and others added 17 commits October 2, 2026 07:57
The popup derived the prefix file to source from the prefix key, so any
prefix other than C-a/C-b/C-g looked for a tmux.prefix-*.conf that does not
exist and was silently ignored, leaving the popup on the console server's
own prefix.

Copy the prefix value over instead and rebind send-prefix, so a prefix such
as C-Space carries into the popup too.
The #{=14:...} form truncates to 14 characters rather than padding, which cut
fortes-deval-runner down to fortes-deval-r. #{p14:...} pads instead, so short
hostnames keep the date and time in place, and long ones stay readable rather
than being chopped mid-word.
The config lives in ~/.config/tmux now, so ~/.tmux.conf.local was a leftover
from the pre-XDG layout and no longer sits next to the file it overrides.
Look for ~/.config/tmux/tmux.conf.local, matching the .bashrc.local
convention used elsewhere in the repo.
select-window -T makes the binding a toggle, so Alt-<number> for the window
you are already on jumps back to the previously active one. That reads like
a typo in the config, so spell it out.
-a appends whole new array elements, so a leading comma only introduces an
empty entry that is discarded: the resulting feature list is identical with
or without it. Keep the two appends consistent.
The item reused toggle_command, so Stop only paused, and stop_command was
never used.
Under set -e + pipefail a non-matching grep inside a command substitution
aborts the script, so a track without an albumartist tag left the status
line blank and a track without a genre tag meant the menu never opened at
all. Tolerate no match and treat the tag as empty, and stay blank instead of
printing a bare separator when a file has no usable tags.
The status command runs on every status-interval and sourced the whole
profile just to borrow the command_exists helper. Check for cmus-remote
directly instead.
The tmux config sources a machine-local ~/.config/tmux/tmux.conf.local, and
without a REAL_DIRS entry stow folds a fresh ~/.config/tmux into a symlink
into the repo, so that override would land in the working tree as an
untracked, host-specific file. The old ~/.tmux.conf.local lived in $HOME and
could never be folded.

Verified against a scratch target: ~/.config/tmux is now a real directory
holding individual symlinks.
The guard tested all four tags together, so a track carrying only an album
tag still printed a bare separator. Test the fields the branch actually
renders instead.
Match tmux-music-status so both helpers rely on the tmux server's
environment rather than sourcing a shell profile from a non-interactive
helper, and check for cmus-remote with the command -v builtin. Also drop
the unused play_status local that shellcheck flags.
source-file -q swallows the missing file, so a machine still holding the
pre-XDG override would lose it with no warning.
make test's format-check fails on main because these files drift from
shfmt -i 2 -ci -bn, which leaves the Bash Syntax Check & Lint workflow red.
Formatting only, no behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Creating a REAL_DIRS entry is skipped when the path already exists, so on
machines stowed before .config/tmux was added, ~/.config/tmux stays a
symlink into the repo and tmux.conf.local still lands in the working tree.
Remove the symlink when it resolves into stowed-files so stow relinks the
contents individually; symlinks pointing elsewhere are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file only exists on Linux, so linting on macOS failed with SC1091.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A scoped run like `script/stow -R tmux` removed every folded REAL_DIR,
then only restowed tmux, leaving e.g. ~/.local/bin from the bash package
empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fortes-figma
fortes-figma force-pushed the imported-coder-box-changes branch from edff2be to 5512bb9 Compare October 2, 2026 11:57
@fortes
fortes merged commit 88d5fca into main Oct 2, 2026
1 check passed
@fortes
fortes deleted the imported-coder-box-changes branch October 2, 2026 11:58
fortes-figma pushed a commit that referenced this pull request Oct 2, 2026
* tmux: Fix the console popup dropping an unusual prefix

The popup derived the prefix file to source from the prefix key, so any
prefix other than C-a/C-b/C-g looked for a tmux.prefix-*.conf that does not
exist and was silently ignored, leaving the popup on the console server's
own prefix.

Copy the prefix value over instead and rebind send-prefix, so a prefix such
as C-Space carries into the popup too.

* tmux: Don't truncate the hostname in the status bar

The #{=14:...} form truncates to 14 characters rather than padding, which cut
fortes-deval-runner down to fortes-deval-r. #{p14:...} pads instead, so short
hostnames keep the date and time in place, and long ones stay readable rather
than being chopped mid-word.

* tmux: Read local overrides from the XDG config path

The config lives in ~/.config/tmux now, so ~/.tmux.conf.local was a leftover
from the pre-XDG layout and no longer sits next to the file it overrides.
Look for ~/.config/tmux/tmux.conf.local, matching the .bashrc.local
convention used elsewhere in the repo.

* tmux: Document the toggle behaviour of the Alt-<number> bindings

select-window -T makes the binding a toggle, so Alt-<number> for the window
you are already on jumps back to the previously active one. That reads like
a typo in the config, so spell it out.

* tmux: Drop the redundant comma in the terminal-features appends

-a appends whole new array elements, so a leading comma only introduces an
empty entry that is discarded: the resulting feature list is identical with
or without it. Keep the two appends consistent.

* cmus: Send --stop for the menu's Stop item

The item reused toggle_command, so Stop only paused, and stop_command was
never used.

* cmus: Keep working when a track is missing a tag

Under set -e + pipefail a non-matching grep inside a command substitution
aborts the script, so a track without an albumartist tag left the status
line blank and a track without a genre tag meant the menu never opened at
all. Tolerate no match and treat the tag as empty, and stay blank instead of
printing a bare separator when a file has no usable tags.

* cmus: Drop the ~/.profile source from tmux-music-status

The status command runs on every status-interval and sourced the whole
profile just to borrow the command_exists helper. Check for cmus-remote
directly instead.

* stow: Keep ~/.config/tmux a real directory

The tmux config sources a machine-local ~/.config/tmux/tmux.conf.local, and
without a REAL_DIRS entry stow folds a fresh ~/.config/tmux into a symlink
into the repo, so that override would land in the working tree as an
untracked, host-specific file. The old ~/.tmux.conf.local lived in $HOME and
could never be folded.

Verified against a scratch target: ~/.config/tmux is now a real directory
holding individual symlinks.

* cmus: Only blank the status when the branch's tags are missing

The guard tested all four tags together, so a track carrying only an album
tag still printed a bare separator. Test the fields the branch actually
renders instead.

* cmus: Drop the ~/.profile source from tmux-music-menu

Match tmux-music-status so both helpers rely on the tmux server's
environment rather than sourcing a shell profile from a non-interactive
helper, and check for cmus-remote with the command -v builtin. Also drop
the unused play_status local that shellcheck flags.

* tmux: Note that the local config moved from ~/.tmux.conf.local

source-file -q swallows the missing file, so a machine still holding the
pre-XDG override would lose it with no warning.

* script: Apply shfmt formatting to script/

make test's format-check fails on main because these files drift from
shfmt -i 2 -ci -bn, which leaves the Bash Syntax Check & Lint workflow red.
Formatting only, no behaviour change.

* tmux: Point the prefix-menu comment at the XDG local config

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* stow: Unfold REAL_DIRS that an earlier run already folded

Creating a REAL_DIRS entry is skipped when the path already exists, so on
machines stowed before .config/tmux was added, ~/.config/tmux stays a
symlink into the repo and tmux.conf.local still lands in the working tree.
Remove the symlink when it resolves into stowed-files so stow relinks the
contents individually; symlinks pointing elsewhere are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Let shellcheck skip /etc/os-release in install_tailscale

The file only exists on Linux, so linting on macOS failed with SC1091.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* stow: Only unfold REAL_DIRS belonging to the packages being stowed

A scoped run like `script/stow -R tmux` removed every folded REAL_DIR,
then only restowed tmux, leaving e.g. ~/.local/bin from the bash package
empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Filipe Fortes <accounts@fortes.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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