The Windows Terminal made better with the Command Palette plus Multiple Actions in one Command
I thought I knew everything about the open source Windows Terminal and then I hit Ctrl+Shift+P like I do in VS Code (muscle memory) and it pops up a lovely Command Palette. You can search for any command and see the current keybinding. Super useful if you haven't yet discovered Window Panes. You can also type new wt.exe command lines and affect the current window.
NOTE: Don't forget, "wt" is an alias for the Windows Terminal, so you can Win+R and type wt and run it!
You can create your own commands and even nest them in the Palette! You can even iterate over other objects/profiles in your settings and dynamically create commands!
Since the wt.exe allows for chained commands, I can create a custom command in settings that calls wt.exe with chained commands/actions and bingo, I have a command called Development that opens multiple profiles, splits the screen and sets me up for Windows+Linux development in a single move!
Here I have a new command called Development that calls wt with a new-tab with a named profile, then a split-pane with another named profile.
"keybindings":
[
{
"command":
{
"action": "wt",
"commandline": "new-tab -p \"Powershell\" ; split-pane -p \"Ubuntu-18.04\""
},
"name": "Development"
},
...
Here's the result!
Oh, and by the way, you can also apply Shaders to the Windows Terminal...in real time! So that's AWESOME.
Have fun! Thanks to Kayla for her help on this post!
Sponsor: The No. 1 reason developers choose Couchbase? You can use your existing SQL++ skills to easily query and access JSON. That’s more power and flexibility with less training. Learn more.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Just CTRL-SHIFT-F to "Find"... in the console?!?
OK, I'm sold. Getting a fresh coffee, then I'm going to look closer at the wt options.
c:\users\the-user-account\AppData\Local\Microsoft\WindowsApps\wt.exe
If you have both the normal and preview releases installed, then you will have 2 folders beneath this folder Microsoft.WindowsTerminal_8wekyb3d8bbwe and Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe. They both have a wt.exe in this folder. For it to work with Win + X - copy the preview wt.exe into the top level folder - finished.
This should also make this version the default when launching from Win + R or from a command prompt.
{ "command": {
"action": "wt",
"commandline": "new-tab -p \"Powershell\" -d c:\\SourceCode\\MyServerCode ; split-pane -p \"Powershell\" -d c:\\SourceCode\\MyClientCode"
},
"name": "IMS"
},
I have struggled having both Preview and Default installed and switching between them.
Comments are closed.
This is very useful! But is there any, official, reference on what we can actually use in "commandline" JSON property and in which way. Because some of the commands, like splitPane have some arguments for the direction of the split and I found it in
here
Thanks in advance