Start new tab in last used tab working dir path [BUG] #17863

Closed
opened 2026-01-31 05:56:39 +00:00 by claunia · 6 comments
Owner

Originally created by @QuAzI on GitHub (Jul 5, 2022).

It is better to use last working dir for new tab instead of first random chosen path
image

Originally created by @QuAzI on GitHub (Jul 5, 2022). It is better to use last working dir for new tab instead of first random chosen path ![image](https://user-images.githubusercontent.com/1897605/177285731-1e9993ba-3908-4c9c-b443-a5a75c4da56c.png)
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 05:56:39 +00:00
Author
Owner

@QuAzI commented on GitHub (Jul 5, 2022):

As example I started wt in any dir. Then I ran through FM (Explorer, TotalCommander... doesn't matter) CMD file which starts two copies of nodejs (es5, es6) in the same tab.

CMD example

start wt -d ./src/ApplicationFrontend/  pwsh.exe -NoExit -command npm run watch-debug-es5-only; split-pane -d ./src/ApplicationFrontend/ powershell.exe -NoExit -command npm run watch-debug-es6-only

now my script crashes because start path broken. It is not script path and not last used path. It means even if I run my script from wt - it crashes if wt started not from current path. So I must close all tabs and start from begin

[error 2147942667 (0x8007010b) when launching `pwsh.exe -NoExit -command npm run watch-debug-es5-only']
Could not access starting directory "./src/ApplicationFrontend/"
@QuAzI commented on GitHub (Jul 5, 2022): As example I started wt in any dir. Then I ran through FM (Explorer, TotalCommander... doesn't matter) CMD file which starts two copies of nodejs (es5, es6) in the same tab. CMD example ``` start wt -d ./src/ApplicationFrontend/ pwsh.exe -NoExit -command npm run watch-debug-es5-only; split-pane -d ./src/ApplicationFrontend/ powershell.exe -NoExit -command npm run watch-debug-es6-only ``` now my script crashes because start path broken. It is not script path and not last used path. It means even if I run my script from wt - it crashes if wt started not from current path. So I must close all tabs and start from begin ``` [error 2147942667 (0x8007010b) when launching `pwsh.exe -NoExit -command npm run watch-debug-es5-only'] Could not access starting directory "./src/ApplicationFrontend/" ```
Author
Owner

@QuAzI commented on GitHub (Jul 5, 2022):

And even this workaround in start of script doesn't helps

cd %~dp0
@QuAzI commented on GitHub (Jul 5, 2022): And even this workaround in start of script doesn't helps ``` cd %~dp0 ```
Author
Owner

@zadjii-msft commented on GitHub (Jul 7, 2022):

Wait what exactly is the bug here?

Do you have "New instance behavior" set to "Create a new window" or "Attach to the most recent..."? Trying this out locally, I got the same error message when the tab was opening in an existing WT window. When it gets sent to a new window though, it seems to work fine

I was sure this was on the backlog somewhere... found it, or at least what I've been using to track this: #5506

@zadjii-msft commented on GitHub (Jul 7, 2022): Wait what exactly is the bug here? Do you have "New instance behavior" set to "Create a new window" or "Attach to the most recent..."? Trying this out locally, I got the same error message when the tab was opening in an existing WT window. When it gets sent to a new window though, it seems to work fine I was sure this was on the backlog somewhere... found it, or at least what I've been using to track this: #5506
Author
Owner

@QuAzI commented on GitHub (Jul 11, 2022):

"Attach to the most recent..." of course because it is more comfortable to have one window with multiple tabs. But it doesn't mean that this window combine only instances with same working dir.

@QuAzI commented on GitHub (Jul 11, 2022): "Attach to the most recent..." of course because it is more comfortable to have one window with multiple tabs. But it doesn't mean that this window combine only instances with same working dir.
Author
Owner

@zadjii-msft commented on GitHub (Jul 11, 2022):

Okay, yea, that'll be fixed by #5506 then. Thanks!

/dup #5506

@zadjii-msft commented on GitHub (Jul 11, 2022): Okay, yea, that'll be fixed by #5506 then. Thanks! /dup #5506
Author
Owner

@ghost commented on GitHub (Jul 11, 2022):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jul 11, 2022): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17863