You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New tab doesn't inherit working directory for -d #18604
Press Win+R
Execute wt -d c:\Projects to specify the folder that should be used as the starting directory for the console (according to documentation)
Open a new tab
Expected Behavior
For cases when wt -d used target directory should be inherited properly for new tabs and should be equal as the starting directory specified on console run
Actual Behavior
Currently, the path is C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.22.10352.0_x64__8wekyb3d8bbwe> instead of what you chose as the starting directory
If I'm reading you right, you basically want to be able to have -d . apply to additional tabs created in that terminal window, not just the tab that wt -d . opens. I suspect that just using "Duplicate tab" rather than "Open new tab" will probably get you want you want here.
-d . means that I will use the current directory, not the starting directory. So, it's different.
At the same time, Duplicate tab starts with the starting directory, while I expected that it will inherit the current path too) And it absolutely doesn't work for different profiles, WSL for example
same here, I remember it work before but not latest Terminal Preview version. Duplicate tab work but can not switch profile like from Git bash to CMD. new CMD tab will open system32 instead of Parent process directory
"duplicate tab" needs to copy the NewTerminalArgs from the previous tab, not sure if we did all those. Pretty sure there's a thread for that. But IIRC we already duplicated the CWD.
-d . is Special though, cause it has to evaluate based on the CWD that the wt command was run in.
So duplicating a tab with -d . needs to evaluate the startingDirectory not as . but as... one of?
the CWD of the tab being duplicated (else the CWD that tab was launched in)
just the CWD that tab was launched in (ignore the CWD of that tab now)
For me Duplicate sounds like "same shell in the same path", so CWD of the tab being duplicated. But NEW tab ("+") should be based on CWD that main tab/wt was launched
Activity
zadjii-msft commentedon Feb 26, 2025
Lemme at least cross link some thoughts here:
If I'm reading you right, you basically want to be able to have
-d .apply to additional tabs created in that terminal window, not just the tab thatwt -d .opens. I suspect that just using "Duplicate tab" rather than "Open new tab" will probably get you want you want here.QuAzI commentedon Feb 27, 2025
-d .means that I will use the current directory, not the starting directory. So, it's different.At the same time,
Duplicate tabstarts with the starting directory, while I expected that it will inherit the current path too) And it absolutely doesn't work for different profiles, WSL for examplequyenvsp commentedon Mar 18, 2025
same here, I remember it work before but not latest Terminal Preview version.
Duplicate tabwork but can not switch profile like from Git bash to CMD. new CMD tab will opensystem32instead ofParent process directoryDHowett commentedon Mar 26, 2025
This may have regressed in our windowing and remoting rewrite in #18215. Thanks!
DHowett commentedon Mar 26, 2025
Actually, given that the original report is on 1.22 and Quyen Le Van (@quyenvsp) is talking about Preview... there may be two issues here.
zadjii-msft commentedon Mar 27, 2025
okay team notes:
-d .is Special though, cause it has to evaluate based on the CWD that thewtcommand was run in.-d .needs to evaluate thestartingDirectorynot as.but as... one of?QuAzI commentedon Mar 27, 2025
For me Duplicate sounds like "same shell in the same path", so CWD of the tab being duplicated. But NEW tab ("+") should be based on CWD that main tab/wt was launched
lhecker commentedon Apr 16, 2025
Oh, I forgot to close this issue when I fixed the bug in #18801. It'll go out in the next bug fix release. Thanks everyone!