SIGN IN SIGN UP
microsoft / terminal UNCLAIMED

The new Windows Terminal and the original Windows console host, all in the same place!

0 0 92 C++

Implement OSC 7 for setting the CWD (#20019)

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 ✅)
L
Leonard Hecker committed
4ce79d728932b5140b9b8323c40f96d054cd1527
Parent: 69e4590
Committed by GitHub <noreply@github.com> on 3/30/2026, 6:10:26 PM