Skip to content

Fix default tmux splits to preserve the current directory - #11205

Open
SamRoehrich wants to merge 1 commit into
omacom:quattrofrom
SamRoehrich:fix/tmux-split-current-directory
Open

SamRoehrich wants to merge 1 commit into
omacom:quattrofrom
SamRoehrich:fix/tmux-split-current-directory

Conversation

@SamRoehrich

Copy link
Copy Markdown

Summary

Bind the standard prefix + % and prefix + " split shortcuts with -c "#{pane_current_path}", matching the existing Omarchy custom split shortcuts and their descriptive binding style.

Without this override, the standard shortcuts use tmux’s default starting directory rather than the active pane’s current directory. This makes the result depend on which split shortcut is used.

Reproduction

  1. Start a tmux session in one directory.
  2. Change to a different directory in the active pane.
  3. Split with prefix + % or prefix + ".
  4. Run pwd in the new pane. It should match the source pane, as it already does with the custom h/v shortcuts.

This updates the default config. Existing users can add the two bindings to their config and reload it; no automatic migration of user keybindings is included.

Verification

  • Loaded the updated config into an isolated tmux server, with a session starting in / and its source pane running in a different directory. Executed each loaded split binding’s command and verified both child panes inherited the source directory.
  • git diff --check passed.
  • Ran ./test/all: CLI suite passed; shell suite reported 5 failures out of 236 test files:
    • config-test.sh, snapper-test.sh, and unowned-system-paths-test.sh: missing companion omarchy-pkgs checkout. Reproduced on unchanged upstream.
    • screenshot-sanity-test.sh: screenshot capture failed with a jq parsing error. Reproduced on unchanged upstream.
    • locate-test.sh: UTF-8 decoding error while scanning runtime files during the aggregate run. A clean upstream worktree passed the focused test; the aggregate run left an ignored bin/__pycache__/ directory in its checkout.

@johnpippett johnpippett left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local tests showed no defect that prevents approval.
Codex did these tests.

Source commit: e5a0e58947ebbc4623c47d5ab5f893e2129e2d2c.
Comparison commit: 8ea51516390320f8e768808b230098e67bdaa82c.

The % and " prefix bindings create each new pane in the active pane directory.
The coordinator used the actual key sequences through an attached tmux 3.7c client.
The source commit gives the expected results for both split directions with a directory name that contains spaces.
The results are also correct after the directory moves to a new path.
The comparison commit uses the session directory in all three cases.

The new-window key keeps the active directory on both commits.
The test records the original window and checks the new window after the key sequence.
All eight functional cases give the expected results, including three comparison failures.

The test uses private sockets, namespaces, and fixture directories.
It does not use the current terminal or user configuration.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants