Skip to content

fix(shell): tmux session mirroring, PATH sanitization, and tooling fixes - #191

Open
wanferno wants to merge 2 commits into
Gentleman-Programming:mainfrom
wanferno:fix/shell-config-improvements
Open

wanferno wants to merge 2 commits into
Gentleman-Programming:mainfrom
wanferno:fix/shell-config-improvements

Conversation

@wanferno

Copy link
Copy Markdown

Summary

Five fixes found while debugging a real user environment where every new terminal window mirrored the previous one (same tmux session attached twice).

Changes

GentlemanFish/fish/config.fish

  1. Fisher bootstrap was dead: git.io shortlinks were shut down by GitHub in 2023, so first-run plugin installation silently failed. Replaced with the official raw.githubusercontent.com URL and chained with and.
  2. Unsafe PATH entries: removed $HOME/.config and glob-expanded /usr/local/lib/* from PATH (both make arbitrary non-executable content resolvable as commands), plus a duplicated $HOME/.cargo/bin append.
  3. bat as MANPAGER: bat is already installed by these dotfiles; man pages now render with syntax highlighting.
  4. Removed trailing clear so shell startup errors are visible.

GentlemanTmux/tmux.conf

  1. Session mirroring fix: tmux new-session -A -s main attaches every new terminal to the same session — windows become mirrors of each other with synced changes. Each interactive shell now creates its own uniquely named session (term-<epoch>-<random>).
  2. history-limit 100000 (default is only 2000 lines per pane).
  3. M-l lazygit popup, following the existing M-g scratch popup pattern.

installer/internal/system

  • Updated fishMultiplexerBlock accordingly: without this, PatchFishForWM would regenerate the old -A -s main block on every install and reintroduce the mirroring behavior.
  • Updated TestPatchFishForWM expectation to assert the new invocation AND that the old one is gone.

Verification

  • go test ./internal/system/ -count=1 in installer/ ✅
  • fish -n config.fish syntax check ✅

- Replace dead git.io shortlink (shut down by GitHub in 2023) with the
  official raw.githubusercontent.com fisher bootstrap URL, and chain the
  install with 'and' so a failed download does not run install anyway.
- Remove $HOME/.config and /usr/local/lib/* from PATH: exposing config
  dirs and glob-expanded library paths as executable sources is unsafe.
- Remove duplicate $HOME/.cargo/bin entry appended after tool init.
- Use bat as MANPAGER (bat is already installed by this dotfiles set).
- Drop trailing 'clear' so startup errors are visible.
tmux new-session -A -s main attached every new terminal window to the
same 'main' session, mirroring it across terminals. Each interactive
fish shell now creates its own uniquely named session instead.

The installer's generated multiplexer block (fishMultiplexerBlock) is
updated too, otherwise PatchFishForWM would regenerate the mirroring
behavior on every install. Test expectation updated accordingly.

Also adds history-limit 100000 (default 2000 lines is small for logs)
and an M-l lazygit floating popup following the existing M-g pattern.
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