8000 Inherit the active terminal’s shell for splits and new tabs by strayge · Pull Request #422 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

Inherit the active terminal’s shell for splits and new tabs - #422

Merged
amirlehmam merged 2 commits into
amirlehmam:masterfrom
strayge:feat/inherit-focused-shell
Nov 3, 2026
Merged

amirlehmam merged 2 commits into
amirlehmam:masterfrom
strayge:feat/inherit-focused-shell

Conversation

@strayge
@strayge strayge commented Nov 2, 2026 •
Copy link
Copy Markdown
Contributor

Problem

Splitting a terminal or opening a new tab uses the workspace/default shell instead of the active terminal’s shell.
For example, splitting a WSL terminal can unexpectedly open PowerShell.

Changes

  • Inherit the active terminal’s launch shell for keyboard and tab-bar split/new-tab actions.
  • Capture the effective launch specification with the live PTY, preserving shell launch arguments, such as the selected WSL distribution.
  • Add tests for shell selection, argument preservation, PTY reuse, and fallback behavior.

Limitations

Inheritance follows only the shell launched by wmux.
Manually running wsl or ssh inside PowerShell does not change the inherited shell.

Testing

  • Full suite passed: 6,406 tests passed, 10 skipped across 387 passing test files.
  • npm run typecheck: passed.
  • git diff --check: passed.
  • Manually verified shell inheritance for splits and new tabs.

@strayge
strayge marked this pull request as ready for review November 2, 2026 00:37
splitNode is shared with CLI, agent-browser and pipe splits, which type
startup commands; inheriting there could type them into an ssh or WSL
shell. The shell is now an opt-in argument passed only by the keyboard
and tab-bar split actions.

A PTY started with no spec no longer reports its resolved executable as
launchShell, and resolvedShell stays display only, so new tabs never pin
a versioned Store PowerShell path (amirlehmam#334). launchShell is view state for
the session snapshot ring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amirlehmam
amirlehmam merged commit a661ab7 into amirlehmam:master Nov 3, 2026
@amirlehmam
Copy link
Copy Markdown
Owner

Thanks @strayge, merged and shipping in 2.55.0. I pushed one commit on top before merging:

  • Inheritance is now opt-in on splitNode. It is shared with wmux split, the agent-browser install and the other pipe splits, and those type startup commands. Through the shared path, a split of an ssh or WSL pane would have typed npm i -g agent-browser into the remote shell. Only the keyboard and tab-bar actions pass the shell now.
  • A PTY started with no spec reports an empty launchShell, and resolvedShell is display only again. Before, a Store PowerShell's versioned WindowsApps\...\pwsh.exe was copied into every new tab's shell, and an update that deletes that folder breaks restore (Default shell ("System default") caches a Store pwsh path for the whole session; every pane fails after a Store PowerShell update #334).

@strayge
strayge deleted the feat/inherit-focused-shell branch November 8, 2026 18:03
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

0