-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Open different shell in same directory #10232
Comments
I have read the reddit post. This is possible and was actually implemented at the early days of #8166 when we were still trying to make OSC 7 work. Later reusing the CWD was limited to only duplicating tabs/panes, to prevent the feature from being too aggressive. Maybe we can add an option for folks who do love to reuse CWD for every tab created. |
I think it could be also a command in the command palette |
This proposal is exactly the first thing I noticed "missing" when working on the new Terminal (just installed today and wasn't sure if I just didn't dive too deep). My personal use case: I'm working on Windows and writing a tool using bash and perl scripts. Still I prefer managing git through PowerShell (and access to files as well) and use cmd for local management inside Windows with the long familiar commands. Usually I just open Terminal as WSL but when I do commits or other stuff it's just easier to Shift+Right Click and open Powershell from the menu rather than opening a new tab and navigating into the directory. And IMO it defeats the purpose of having multiple different terminals inside one window. No matter how convenient it sounds (and in general it is very convenient) but in this case it's just not the most optimal way. Also - the best possible scenario would be having these option:
|
Hmmmmmmmmmm. Now that I'm thinking about this, and comparing more with the rest of the repo, this might be an argument in favor of option 1 in #9957. We want to duplicate the path, but change the profile. Oh no, wait it might be more complicated than that. It's "mode: duplicatePath", not |
oh boy that seems awfully specific - the new window duplicates the existing window's CWD? I'm cool doing this with a new tab, but the window seems like it might be confusing. I even typed up an issue like this in the past, but I don't think I ever posted it
I think on discussion, we thought that this made a good extension candidate, but those are also 12+mos away, so maybe we should revisit
Like, as a prompt? Like a different version of #3586? Otherwise you can of course just use
That's over in #7071 |
I'm so sorry for the confusion, I actually meant a new Tab. Was just in a rush to get my vision out 😒
In first case I would definitely prefer to have tabs open in the same folder and then navigating to subfolder. Or simply opening a WSL/cmd/gitbash in the same folder. As you can see - it's pretty apparent why having a current folder option would be benefitial In second case I would just open a new window - as it's working now.
This is kind of off-topic for this issue so I'll stop about that but yes, indeed. Excuse me for that as I haven't noticed the setting as I'm really really new to this Terminal |
It strikes me that terminal is not at the layer that knows another shell instance's Current Working Directory. I assume the shell tied to the terminal (tab) via stdin, stdout, and stderr that has such information, not WT. And the shell (and any other command-line app) might not be designed to detect wiring to WT and Terminal Tabs at all. A shell's ability to Start an asynchronous console application might be helpful, although having that wired to a new tab sort of reduces to the previously-unsolved problem. |
This is actually the original request in #3158, but since #3158 (comment) where I called out the next step, that ticket has been filled with people working out how to emit @orcmid Windows Terminal uses the So this use-case is mostly about how we apply that knowledge to "New Tab", or "Split Tab (Not duplicate)", since just changing the default behaviour with no recourse would probably be surprising, while "Duplicate Tab" and "Duplicate Pane" carrying the CWD is pretty hard to disagree with. |
I'm sold. I'll stick it on the backlog. We'll have to come up with some sort of sensible setting for this. Maybe something like an enum - |
@zadjii-msft Any update on this. I regularly duplicate the tab with same directory? But it is very hard to type every time the directory path. I really miss this feature from linux terminal |
@sheikalthaf: If you're duplicating the tab, it should already be keeping the current working directory as of Windows Terminal 1.6, if you have If you don't have |
I'm also looking for a way to duplicate a tab and keep existing current working directory
for each duplicated tab is just an extra step which could be avoid. This behavior should be "out of the box" when installing new version of Terminal |
@scls19fr You're commenting on a ticket about new tabs or splits, not duplicating tabs or splits. Duplicating tabs is #3158, and that's already as done as possible in Windows Terminal; to be truly out-of-the-box, you need your shell to be updated to send the In the meantime, every shell I've come across has had a mechanism to let the user hook something to send that information, and there's a ton of recipes in the history #3158, and eventually, someone will document it nicely in MicrosoftDocs/terminal#285. |
Description of the new feature/enhancement
Sometimes, it so happens that I am in (lets say) powershell, and i am working on something, and i change directory to some location, and i find myself in need of a different shell for some reason. Just as an example, maybe i have to run a bash script present in that directory using Git Bash / Msys.
Asked this on reddit and @zadjii-msft asked to open an issue here
Proposed technical implementation details (optional)
No idea
The text was updated successfully, but these errors were encountered: