Skip to content

fix: use correct wt.exe split-pane flags (-H/-V) instead of invalid --direction#20

Merged
jongio merged 3 commits intojongio:mainfrom
wbreza:fix/wt-split-pane-direction
Mar 21, 2026
Merged

fix: use correct wt.exe split-pane flags (-H/-V) instead of invalid --direction#20
jongio merged 3 commits intojongio:mainfrom
wbreza:fix/wt-split-pane-direction

Conversation

@wbreza
Copy link
Copy Markdown
Contributor

@wbreza wbreza commented Mar 20, 2026

Fixes #19

Windows Terminal's split-pane subcommand does not support a --direction flag. The code was passing --direction down which WT didn't recognize, causing it to treat down as the command to execute -- resulting in a 'file not found' error.

Changes:

  • Added appendWTPaneDirFlags() helper to translate pane direction config values to the correct wt.exe flags (-H for horizontal, -V for vertical)
  • Updated launchWindowsSession() and buildWSLWTArgs() to use the new helper
  • Updated WSL test expectations to match

…-direction

Windows Terminal's split-pane subcommand does not support a --direction flag.
Replace --direction <value> with the correct -H (horizontal) and -V (vertical)
flags in both launchWindowsSession and buildWSLWTArgs.

Fixes jongio#19

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wbreza wbreza requested a review from jongio as a code owner March 20, 2026 21:47
Cover all pane directions (down, up, right, left, auto, empty, unknown),
verify existing args are preserved, and add missing up/left/empty cases
to buildWSLWTArgs test table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@jongio jongio left a comment

Choose a reason for hiding this comment

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

Clean, focused bug fix. appendWTPaneDirFlags() correctly replaces the invalid --direction flag with -H/-V, test coverage is comprehensive (7 direction cases + base-args preservation), and the helper extraction removes duplication between the native and WSL paths.

One minor note: "up" -> -H and "left" -> -V controls split orientation only - Windows Terminal decides actual pane placement. The code comment acknowledges this ("closest available direction"), which is sufficient. Worth noting in the config docs/reference for user clarity.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jongio jongio merged commit 384c30c into jongio:main Mar 21, 2026
2 checks passed
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.

Bug: split-pane launch fails with file not found due to invalid --direction flag for wt.exe

2 participants