Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to remember starting directory from the last tab/session #11783

Closed
working-name opened this issue Nov 18, 2021 · 9 comments
Closed

Option to remember starting directory from the last tab/session #11783

working-name opened this issue Nov 18, 2021 · 9 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@working-name
Copy link

Description of the new feature/enhancement

Hello, I come from iTerm2 on macOS and several linux distros where the most useful part about starting a new tab or window or splitting the current view horizontally or vertically is to be able to be right back where you were in the previous session.

I don't know if this use case is all that unique given the ubiquitous availability of this behavior on other terminal emulators, so I think it would be a step forward.

lG6BxfYeyo.mp4
@working-name working-name added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 18, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 18, 2021
@zadjii-msft
Copy link
Member

This has been discussed numerous times across the repo.

Generally, this is /dup #3158

@ghost
Copy link

ghost commented Nov 18, 2021

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 ghost closed this as completed Nov 18, 2021
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 18, 2021
@working-name
Copy link
Author

This has been discussed numerous times across the repo.

No resolution here, other than what seems like a bunch of workarounds, among which using a different terminal emulator altogether :)

Again, more workarounds, no solution.

Apparently available in beta releases but this is not a similar issue to what I'm asking at all.

This does not duplicate CWD as well, but does duplicate title and such. Running 1.11.2921.0 which is your latest official release.

Settings JSON contains the code as described, however, when using the shortcut I get the same behavior as above: something is duplicated but CWD is not part of it.

  • There's the duplicate tab and split pane menu items which will duplicate by default:
    image

This does the same thing as above - fails to duplicate CWD.

Generally, this is /dup #3158

@working-name
Copy link
Author

Tested 1.12.2931.0, same behavior - no CWD duplication through any of the aforementioned methods.

The "start where we left off" functionality also fails to maintain each tab's prior CWD, it just loads whatever is set as the default. Pretty useless for now.

@zadjii-msft
Copy link
Member

Those threads go into quite a lot of detail - you need to configure your shell to emit information to the Terminal about what the working directory is. You can use the OSC9;9 sequence to emit a Windows path, and then all the duplicate actions will be able to use that path.

The Terminal can't just magically determine the path of the commandline application for a variety of reasons that are detailed in #3158. Most significantly - PowerShell doesn't even change its own CWD, so trying to get the CWD from the attached application automagically will not work more often than it does 😅.

@working-name
Copy link
Author

working-name commented Nov 18, 2021

Oh I see, sorry, I come from macOS and linux which seems to "magically" have that part figured out without me adding stuff to .bashrc. My bad.

So I tried this thing and that won't do. If I simply try to export the variable in bash and change -m to -u to get the linux path which is what I'm trying to preserve, not SMB path to the directory shared from the VM controlled by wsl2... ( 🙄 ) - it just exits windows terminal. All of it.🤣

Also no idea what "ctrl +d" is supposed to do by default if not duplicate tab. I did not override the shortcut and it doesn't appear in the settings JSON but it closes the current tab when pressed.

So in your comment from 2020 you expressed dissatisfaction with people who are not willing to read through hundreds of comments across several threads - it's just A LOT to go through, and if you have no clue what OSC is, that's not helpful 😞. I skimmed through the links you posted above, and stopped where there was some code block. But that's about it, the rest of the conversation about OSC and different implementations in others OSes are well above my head.

You also mentioned that the team had then found a solution that you were happy with. Would you happen to know if that's the same as the stuff above? Is it posted anywhere?

jFHf28kgLa.mp4

@zadjii-msft
Copy link
Member

Sorry, we've been meaning to write a tutorial on that for a while now, just never had the time. I wrote up a guide over at https://github.com/MicrosoftDocs/terminal/pull/449/files. That might help explain what's all needed to get this to work.

@kudorgyozo
Copy link

This application is pretty much useless without this feature. I will still need to use ConEmu it seems.

@DHowett
Copy link
Member

DHowett commented Jun 15, 2023

You are welcome to use whatever terminal emulator you would like on Windows.

@microsoft microsoft locked and limited conversation to collaborators Jun 15, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants