Fix default tmux splits to preserve the current directory - #11205
SamRoehrich wants to merge 1 commit into
Conversation
johnpippett
left a comment
There was a problem hiding this comment.
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.
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
%or prefix +".pwdin the new pane. It should match the source pane, as it already does with the customh/vshortcuts.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
/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 --checkpassed../test/all: CLI suite passed; shell suite reported 5 failures out of 236 test files:config-test.sh,snapper-test.sh, andunowned-system-paths-test.sh: missing companionomarchy-pkgscheckout. 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 ignoredbin/__pycache__/directory in its checkout.