One click to open different profiles #10797

Closed
opened 2026-01-31 02:30:34 +00:00 by claunia · 4 comments
Owner

Originally created by @o1x3 on GitHub (Sep 27, 2020).

Description of the new feature/enhancement

I have 4 profiles in my Windows Terminal App -- Ubuntu, Arch (unofficial), Cmd and Powershell.

I have set the default to Ubuntu because that's what I use the most. However this means that if I want to use cmd through the Windows Terminal, I have to open it and wait a second for it to load Ubuntu and then open up the cmd tab.

Now my suggestion is perhaps a command line flag or something for the wt.exe, which will allow us to open the specific environment while keeping the current profile customization.

I know I can do wt.exe nt -p <profile name> to open the specific environment, but opening it this way, opens the app with the default settings.

My current work around for this is to use a python script which when opened, modifies profile.json with the changed guid of default shell and opens wt.exe depending on the parameter I give to the script. But as I'm sure you guys can tell, this is going to be fairly slow and ineffective in the long run.

If the wt.exe executable will support opening specific environments while keeping the settings, we can even map it to a shortcut and the whole process gets a whole lot easier

Originally created by @o1x3 on GitHub (Sep 27, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement I have 4 profiles in my Windows Terminal App -- Ubuntu, Arch (unofficial), Cmd and Powershell. I have set the default to Ubuntu because that's what I use the most. However this means that if I want to use cmd through the Windows Terminal, I have to open it and wait a second for it to load Ubuntu and then open up the cmd tab. Now my suggestion is perhaps a command line flag or something for the wt.exe, which will allow us to open the specific environment **while keeping the current profile customization**. I know I can do `wt.exe nt -p <profile name> ` to open the specific environment, but opening it this way, opens the app with the default settings. My current work around for this is to use a python script which when opened, modifies profile.json with the changed guid of default shell and opens wt.exe depending on the parameter I give to the script. But as I'm sure you guys can tell, this is going to be fairly slow and ineffective in the long run. If the wt.exe executable will support opening specific environments while keeping the settings, we can even map it to a shortcut and the whole process gets a whole lot easier <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@driver1998 commented on GitHub (Sep 29, 2020):

What do you mean by "current profile customization"? Things like environment variables, current directory, etc?

@driver1998 commented on GitHub (Sep 29, 2020): What do you mean by "current profile customization"? Things like environment variables, current directory, etc?
Author
Owner

@zadjii-msft commented on GitHub (Sep 29, 2020):

The new-tab command already accepts another commandline as a parameter, to override a profile's given one. So wt new-tab -p "Windows Powershell" cmd.exe would run cmd.exe in your "Windows Powershell" profile. Or even wt new-tab -p "Windows Powershell" -- wsl -d Ubuntu to boot up your Ubuntu distro. You can use -- to denote the start of the commandline you want to pass in.

Is that what you're looking for?

@zadjii-msft commented on GitHub (Sep 29, 2020): The `new-tab` command already accepts another commandline as a parameter, to override a profile's given one. So `wt new-tab -p "Windows Powershell" cmd.exe` would run `cmd.exe` in your "Windows Powershell" profile. Or even `wt new-tab -p "Windows Powershell" -- wsl -d Ubuntu` to boot up your Ubuntu distro. You can use `--` to denote the start of the commandline you want to pass in. Is that what you're looking for?
Author
Owner

@o1x3 commented on GitHub (Sep 29, 2020):

@zadjii-msft

What do you mean by "current profile customization"? Things like environment variables, current directory, etc?

I meant the color schemes , the starting directory, etc

@o1x3 commented on GitHub (Sep 29, 2020): @zadjii-msft > What do you mean by "current profile customization"? Things like environment variables, current directory, etc? I meant the color schemes , the starting directory, etc
Author
Owner

@o1x3 commented on GitHub (Sep 29, 2020):

The new-tab command already accepts another commandline as a parameter, to override a profile's given one. So wt new-tab -p "Windows Powershell" cmd.exe would run cmd.exe in your "Windows Powershell" profile. Or even wt new-tab -p "Windows Powershell" -- wsl -d Ubuntu to boot up your Ubuntu distro. You can use -- to denote the start of the commandline you want to pass in.

Is that what you're looking for?

@zadjii-msft I guess now I figured out a different way to do this now.

I found 3 wt.exe files
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.4.2652.0_x64__8wekyb3d8bbwe\wt.exe
C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\wt.exe
C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\wt.exe

When I run wt.exe -p "Command Prompt" on the 2nd and 3rd executables, it opens the correct profile with all the customization and stuff, I've made in settings.json

But even if I run the first wt.exe, even without any arguments, the OOBE Terminal comes.
See the screenshots to see what I'm talking about

image
👆 This is the terminal which opens when I open 2nd and 3rd executables

InkedAnnotation 2020-09-29 120740_LI
👆 This opens up when I open the 1st executable

So now I just created a shortcut to the 3rd executable with -p as the argument and it worked just like it should

@o1x3 commented on GitHub (Sep 29, 2020): > The `new-tab` command already accepts another commandline as a parameter, to override a profile's given one. So `wt new-tab -p "Windows Powershell" cmd.exe` would run `cmd.exe` in your "Windows Powershell" profile. Or even `wt new-tab -p "Windows Powershell" -- wsl -d Ubuntu` to boot up your Ubuntu distro. You can use `--` to denote the start of the commandline you want to pass in. > > Is that what you're looking for? @zadjii-msft I guess now I figured out a different way to do this now. I found 3 wt.exe files `C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.4.2652.0_x64__8wekyb3d8bbwe\wt.exe` `C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\wt.exe` `C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\wt.exe` When I run wt.exe -p "Command Prompt" on the 2nd and 3rd executables, it opens the correct profile with all the customization and stuff, I've made in settings.json But even if I run the first wt.exe, even without any arguments, the OOBE Terminal comes. See the screenshots to see what I'm talking about ![image](https://user-images.githubusercontent.com/34067026/94521325-7b567b00-024b-11eb-9e59-b8c366f802d4.png) 👆 This is the terminal which opens when I open 2nd and 3rd executables ![InkedAnnotation 2020-09-29 120740_LI](https://user-images.githubusercontent.com/34067026/94522040-a097b900-024c-11eb-802a-12fbc9e1cd69.jpg) 👆 This opens up when I open the 1st executable So now I just created a shortcut to the 3rd executable with -p <profile name> as the argument and it worked just like it should
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10797