Ubuntu profile does not start in "Starting directory" on first use. #13889

Open
opened 2026-01-31 03:55:00 +00:00 by claunia · 0 comments
Owner

Originally created by @DrRZ on GitHub (May 24, 2021).

Windows Terminal version (or Windows build number)

1.7.1033.0

Other Software

Ubuntu 20.04 WSL2

Steps to reproduce

Set the Ubuntu profile's "Starting directory" to some location, eg: \wsl$\Ubuntu\home\username to start in the home folder.
Open a Ubuntu tab in Windows Terminal.

Expected Behavior

The Ubuntu tab should open with the current directory set to that specified in the "Starting directory" setting for the Ubuntu profile.

Actual Behavior

The Ubuntu tab opens with the current directory set to %userprofile% ("C:\Users\User Name"). This is the default setting for the starting directory.

Note that this occurs on the first launch of a new Ubuntu tab. On subsequent tabs (either in the same window or a new window or after closing and restarting Windows Terminal) Ubuntu tabs DO open the specified directory. However, after some period of time (several minutes), the first opening of a Ubuntu tab again starts in the %userprofile% directory rather than the specified directory. Subsequent openings (if not too long after) open in the correct folder. Also, if I open Ubuntu from a different shell first, then the first opening of a Ubuntu tab in Windows Terminal does open to the correct location.

I've deleted the json settings file and even uninstalled the reinstalled the Ubuntu distribution for WSL2 but this did not correct the problem. I also only experience this on one computer, but not on my other computer.

Originally created by @DrRZ on GitHub (May 24, 2021). ### Windows Terminal version (or Windows build number) 1.7.1033.0 ### Other Software Ubuntu 20.04 WSL2 ### Steps to reproduce Set the Ubuntu profile's "Starting directory" to some location, eg: \\wsl$\Ubuntu\home\username to start in the home folder. Open a Ubuntu tab in Windows Terminal. ### Expected Behavior The Ubuntu tab should open with the current directory set to that specified in the "Starting directory" setting for the Ubuntu profile. ### Actual Behavior The Ubuntu tab opens with the current directory set to %userprofile% ("C:\Users\User Name"). This is the default setting for the starting directory. Note that this occurs on the first launch of a new Ubuntu tab. On subsequent tabs (either in the same window or a new window or after closing and restarting Windows Terminal) Ubuntu tabs DO open the specified directory. However, after some period of time (several minutes), the first opening of a Ubuntu tab again starts in the %userprofile% directory rather than the specified directory. Subsequent openings (if not too long after) open in the correct folder. Also, if I open Ubuntu from a different shell first, then the first opening of a Ubuntu tab in Windows Terminal does open to the correct location. I've deleted the json settings file and even uninstalled the reinstalled the Ubuntu distribution for WSL2 but this did not correct the problem. I also only experience this on one computer, but not on my other computer.
claunia added the Resolution-Duplicate label 2026-01-31 03:55:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13889