Skip to content

tmux config silently ignored: symlinked ~/.config/tmux/tmux.conf and set -q options #67

Description

@teng-lin

rmux advertises loading an existing tmux config as a fallback when no rmux config is present, but a standard oh-my-tmux install is silently ignored. Two independent bugs compound; both must be fixed to load the config.

Repro

~/.config/tmux/tmux.conf is a symlink to oh-my-tmux (the default install layout), no rmux config present.

$ rmux -S /tmp/x.sock start-server
$ rmux -S /tmp/x.sock show-options -g base-index
base-index 0          # oh-my-tmux sets 1 — config was not applied
$ rmux -S /tmp/x.sock show-messages | grep "config error"
                      # nothing — failure is completely silent

Root causes

1. set -q is parsed but discarded

oh-my-tmux uses set -q -g status-utf8 on / setw -q -g utf8 on for options removed in newer tmux. tmux’s -q suppresses “unknown/ambiguous option” errors. rmux parsed -q and threw it away, so these lines raised invalid option: status-utf8. Because a single config error discards the entire file, the whole config was dropped.

2. The tmux-fallback reader rejects all symlinks

The best-effort tmux reader used symlink_metadata + O_NOFOLLOW and rejected any symlink ("tmux fallback config is not a regular file"). Since the fallback path is best-effort, the error is swallowed — no message, no config. oh-my-tmux installs ~/.config/tmux/tmux.conf as a symlink, so it is silently skipped.

The symlink hardening (commit 2fd8872) was only meant to avoid blocking on a symlink→FIFO; it over-rejected symlink→regular-file.

Fix

  1. Capture -q and suppress unknown/ambiguous-option errors (no-op the command), matching tmux.
  2. Follow symlinks in the fallback reader but stat the target so FIFOs/dirs/devices are still skipped; keep O_NONBLOCK as a second guard.

Out of scope / follow-up

set -g prefix2 C-a still ends up unset after loading — oh-my-tmux’s trailing run-shell apply logic shells out to $TMUX_PROGRAM, a separate tmux-runtime-compat gap.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions