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

newTab on current path #2315

Closed
trajano opened this issue Aug 7, 2019 · 3 comments
Closed

newTab on current path #2315

trajano opened this issue Aug 7, 2019 · 3 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@trajano
Copy link

trajano commented Aug 7, 2019

Description of the new feature/enhancement

When opening a new tab AND OPTIONALLY if the current program in the active shell is not the shell program, use the current path of the active shell as the default path for the newTab action.

Proposed technical implementation details (optional)

There should be an option for this. useCurrentPath in globals which takes in a string of "never", "always", "whenNotShell"

@trajano trajano added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 7, 2019
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 7, 2019
@DHowett-MSFT
Copy link
Contributor

This is one of those things that is impossible in the general case but technically possible. There's a lot of intricacies here, like:

cmd
powershell
cd d:\users

well, powershell isn't the first process we launched. we'd ignore the path d:\users

(in powershell)
cd d:\users

we'd ignore d:\users because powershell doesn't actually set the current working directory (!!)

If your "shell" is ssh dustin@example.com (where we strictly define shell to be "the first process Terminal spawns on your behalf"), its working directory is always going to be C:\windows\system32 regardless of what the remote working directory is.

I'd rather not provide the feature than provide the feature with so many caveats that they'd fill a documentation page. ☹️ sorry.

@DHowett-MSFT
Copy link
Contributor

Thanks, nonetheless, for the suggestion. We'll keep thinking about this.

@trajano
Copy link
Author

trajano commented Aug 8, 2019

Hmm that's kind of odd. I would think it's just a matter of reading the process' current directory https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcurrentdirectory and calling https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw with the directory (then again I haven't traversed through the code base yet).

The part I don't know the API for would likely be trying to determine the process itself which I think should be possible because ProcExp shows the following tree

image

But then even the example above if I used git bash it will be in the wrong folder if you're looking at the first process under conhost.exe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants