forge: add Ctrl+B as a secondary tmux prefix for macOS #11

Merged
pedromcaraujo merged 2 commits from fix/mac-tmux-prefix into main 2026-07-20 09:55:31 +01:00

Summary

On macOS browsers the Ctrl+A tmux prefix doesn't reliably reach the shared tmux server — readline "beginning of line" wins before it hits the prefix binding, so split-pane navigation (prefix ←↑↓→, prefix z, …) breaks. Linux is unaffected.

tmux runs server-side with one shared config, so it can't detect the client OS and per-OS gating isn't possible. Instead:

  • Keep Ctrl+A as the primary prefix — Linux is unchanged.
  • Add Ctrl+B as a global secondary prefix (prefix2) as a reliable fallback on Mac.
  • Ctrl+B Ctrl+B still sends a literal Ctrl+B through (send-prefix -2), mirroring the Ctrl+A Ctrl+A behaviour.
  • Cheat sheet updated to advertise the Mac alternate.

Takes effect on next `nixos-rebuild` — the module's `reloadForgeTmux` activation script re-sources `/etc/tmux.conf` into the live shared server, so existing channels pick it up without killing sessions.

Test plan

  • `nix flake check` passes (CI)
  • Launcher parse passes (CI)
  • After rebuild: `Ctrl+A` prefix still works on Linux
  • `Ctrl+B` prefix works on macOS in a split-pane layout

Closes #10

## Summary On macOS browsers the `Ctrl+A` tmux prefix doesn't reliably reach the shared tmux server — readline "beginning of line" wins before it hits the prefix binding, so split-pane navigation (`prefix ←↑↓→`, `prefix z`, …) breaks. Linux is unaffected. tmux runs server-side with one shared config, so it can't detect the client OS and per-OS gating isn't possible. Instead: - Keep `Ctrl+A` as the **primary** prefix — **Linux is unchanged**. - Add `Ctrl+B` as a **global secondary** prefix (`prefix2`) as a reliable fallback on Mac. - `Ctrl+B Ctrl+B` still sends a literal `Ctrl+B` through (`send-prefix -2`), mirroring the `Ctrl+A Ctrl+A` behaviour. - Cheat sheet updated to advertise the Mac alternate. Takes effect on next \`nixos-rebuild\` — the module's \`reloadForgeTmux\` activation script re-sources \`/etc/tmux.conf\` into the live shared server, so existing channels pick it up without killing sessions. ## Test plan - [ ] \`nix flake check\` passes (CI) - [ ] Launcher parse passes (CI) - [ ] After rebuild: \`Ctrl+A\` prefix still works on Linux - [ ] \`Ctrl+B\` prefix works on macOS in a split-pane layout Closes #10
forge: add Ctrl+B as a secondary tmux prefix for macOS (#10)
Some checks failed
CI / check (pull_request) Has been cancelled
e0753f8d5c
macOS browsers don't reliably deliver Ctrl+A to the shared tmux server —
readline 'beginning of line' wins before it reaches the prefix binding, so
split-pane navigation breaks. tmux is server-side and can't detect the client
OS, so gate-per-OS isn't possible; instead keep Ctrl+A as the primary prefix
(Linux unchanged) and add Ctrl+B as a global secondary prefix (prefix2) as a
reliable fallback. Ctrl+B Ctrl+B still sends a literal Ctrl+B through.

Cheat sheet updated to advertise the Mac alternate.

Closes #10
ci: re-trigger stuck Forgejo run
All checks were successful
CI / check (pull_request) Successful in 41s
ab7a56b656
pedromcaraujo deleted branch fix/mac-tmux-prefix 2026-07-20 09:55:31 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pedromcaraujo/forge!11
No description provided.