Skip to content

Implement OSC 7 for setting the CWD#20019

Open
lhecker wants to merge 1 commit intomainfrom
dev/lhecker/3158-osc7
Open

Implement OSC 7 for setting the CWD#20019
lhecker wants to merge 1 commit intomainfrom
dev/lhecker/3158-osc7

Conversation

@lhecker
Copy link
Member

@lhecker lhecker commented Mar 25, 2026

This adds support for OSC 7 which is the same as OSC 9;9 but using
file URIs. As per the previous discussion in #8214, the problem is
that WSL shells emit URIs that can't work because the hostname in
the URI translates to an UNC path with an non-existing hostname.
In my opinion this doesn't deter the fact though that OSC 7 works
just fine for a native Windows application.

In the future we should consider trying to detect WSL file URIs
and translating it to the --cd argument for wsl.exe.

All of the heavy lifting for parsing the URI is done by
PathCreateFromUrlW. It just had to be plugged into the OSC 9;9 code.

Closes #3158

Validation Steps Performed

  • Launch fish-shell in WSL
  • Duplicate tab works ✅
  • (And because it doesn't work without using
    IsValidDirectory I know that OSC 7 works ✅)

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-Settings Issues related to settings and customizability, for console or terminal Area-VT Virtual Terminal sequence support Product-Conpty For console issues specifically related to conpty Product-Powershell Issues in the modern command interpreter, Powershell.exe. Product-Terminal The new Windows Terminal. labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Settings Issues related to settings and customizability, for console or terminal Area-VT Virtual Terminal sequence support Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Conpty For console issues specifically related to conpty Product-Powershell Issues in the modern command interpreter, Powershell.exe. Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open new terminal tab in same directory as existing tab (OSC 7?)

1 participant