Splitting panes using keyboard shortcut does not persist CWD #17038

Closed
opened 2026-01-31 05:30:34 +00:00 by claunia · 2 comments
Owner

Originally created by @ashishvinayak on GitHub (Mar 18, 2022).

Windows Terminal version

1.11.3471.0

Windows build number

10.0.19043.0

Other Software

Powershell 7.2.1
git-posh

Steps to reproduce

Tutorial mentions that the prompt can be updated to make Powershell emit an escape sequence before creating the new pane. I have added the script to my current profile.
Splitting panes with the mouse splits in CWD but not with the keyboard.

To reproduce:

  1. Update function prompt as provided in the line
  2. Split panes using the keyboard.

Same behavior is seen when starting new tabs with the keyboard.

Expected Behavior

Split pane in the current working directory.

Actual Behavior

Splitting pane in the startingDirectory of the profile

Originally created by @ashishvinayak on GitHub (Mar 18, 2022). ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.19043.0 ### Other Software Powershell 7.2.1 git-posh ### Steps to reproduce [Tutorial](https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory) mentions that the prompt can be updated to make Powershell emit an escape sequence before creating the new pane. I have added the script to my current profile. Splitting panes with the mouse splits in CWD but not with the keyboard. To reproduce: 1. Update function prompt as provided in the line 2. Split panes using the keyboard. Same behavior is seen when starting new tabs with the keyboard. ### Expected Behavior Split pane in the current working directory. ### Actual Behavior Splitting pane in the `startingDirectory` of the profile
Author
Owner

@zadjii-msft commented on GitHub (Mar 18, 2022):

What keyboard shortcut are you using, and which action is it performing? splitPane will only duplicate the path if the action is configured with "splitMode": "duplicate". Notably, the default split pane shortcuts don't include this:

830a422c01/src/cascadia/TerminalSettingsModel/defaults.json (L343-L346)

@zadjii-msft commented on GitHub (Mar 18, 2022): What keyboard shortcut are you using, and which action is it performing? `splitPane` will only duplicate the path if the action is configured with `"splitMode": "duplicate"`. Notably, the default split pane shortcuts don't include this: https://github.com/microsoft/terminal/blob/830a422c015a64cb37196c0b55c2d35d79692fc3/src/cascadia/TerminalSettingsModel/defaults.json#L343-L346
Author
Owner

@ashishvinayak commented on GitHub (Mar 18, 2022):

Okay that worked. Once I add the ´splitMode` to my JSON I am able to duplicate the path as well. Thank you.

@ashishvinayak commented on GitHub (Mar 18, 2022): Okay that worked. Once I add the ´splitMode` to my JSON I am able to duplicate the path as well. Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17038