OSC 9;9 not working in WSL 2/Ubuntu? #17332

Open
opened 2026-01-31 05:39:27 +00:00 by claunia · 0 comments
Owner

Originally created by @dallonf on GitHub (Apr 25, 2022).

Windows Terminal version

1.12.10982.0

Windows build number

10.0.19044.0

Other Software

WSL 2, Ubuntu 20.04.4

Steps to reproduce

  1. Add to .bashrc, as instructed by the documentation:
PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'
  1. cd into a directory other than home directory

  2. Right-click the terminal tab and select "Duplicate Tab"

Expected Behavior

I would expect the new tab to open in the directory I navigated to in step 2.
Failing that, I would love to have some tools to troubleshoot what's going on. What does it think the current directory is?

Actual Behavior

The new tab opens in the home directory, as if I had created a brand new tab, seemingly completely ignoring the current directory.

As much as I hate to open a "it doesn't work" issue, I really am at a loss for how to troubleshoot more.

Originally created by @dallonf on GitHub (Apr 25, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 10.0.19044.0 ### Other Software WSL 2, Ubuntu 20.04.4 ### Steps to reproduce 1. Add to `.bashrc`, as instructed by the [documentation](https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory#bash): ``` PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"' ``` 2. `cd` into a directory other than home directory 3. Right-click the terminal tab and select "Duplicate Tab" ### Expected Behavior I would expect the new tab to open in the directory I navigated to in step 2. Failing that, I would love to have some tools to troubleshoot what's going on. What does it _think_ the current directory is? ### Actual Behavior The new tab opens in the home directory, as if I had created a brand new tab, seemingly completely ignoring the current directory. As much as I hate to open a "it doesn't work" issue, I really am at a loss for how to troubleshoot more.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 05:39:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17332