Windows Terminal newTab Menu
2 years ago, I wrote in another blog post that Windows Terminal is one of my favorite and most used tools after migrating to Windows and WSL2. And even today, it is still the same. Windows Terminal is usually the first tool I start after logging into my Windows box.
In that blog post, I mentioned that I lacked one feature: the possibility to group Terminal bookmarks (e.g., SSH connections to other machines). Recently, I realized the feature was released a while ago. I gave it a try and used this blog post to document the steps I took to configure it in a way that I like.
In your settings.json
file of Windows Terminal, you define the bookmarks (or profiles as Windows Terminal calls them) in the profiles section:
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"profiles": {
"list": [
{
"bellStyle": "none",
"commandline": "wsl.exe /home/shochdoerfer/bin/wslssh.sh customer1@example.com",
"guid": "{61a51b52-d731-4f48-86b2-bf8f96c30ea5}",
"hidden": false,
"icon": "ms-appdata:///roaming/ssh2.png",
"name": "Customer 1"
},
{
"bellStyle": "none",
"commandline": "wsl.exe /home/shochdoerfer/bin/wslssh.sh customer2@example.com",
"guid": "{43a7d68e-9fdd-4e17-a97a-778a41b440e2}",
"hidden": false,
"icon": "ms-appdata:///roaming/ssh2.png",
"name": "Customer 2"
},
{
"bellStyle": "none",
"commandline": "wsl.exe /home/shochdoerfer/bin/wslssh.sh customer3@example.com",
"guid": "{20c42446-2de4-46e4-9f0b-ab8eace938d0}",
"hidden": false,
"icon": "ms-appdata:///roaming/ssh2.png",
"name": "Customer 3"
}
]
}
}
To define the new Tab menu structure, add a newTabMenu
configuration like this:
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"newTabMenu": [
{
"allowEmpty": false,
"entries": [
{
"profile": "{61a51b52-d731-4f48-86b2-bf8f96c30ea5}",
"type": "profile"
}
],
"icon": null,
"inline": "never",
"name": "Customer 1",
"type": "folder"
},
{
"allowEmpty": false,
"entries": [
{
"profile": "{43a7d68e-9fdd-4e17-a97a-778a41b440e2}",
"type": "profile"
}
],
"icon": null,
"inline": "never",
"name": "Customer 2",
"type": "folder"
},
{
"allowEmpty": false,
"entries": [
{
"profile": "{20c42446-2de4-46e4-9f0b-ab8eace938d0}",
"type": "profile"
}
],
"icon": null,
"inline": "never",
"name": "Customer 3",
"type": "folder"
},
{
"type": "remainingProfiles"
}
],
"profiles": {
"list": [
]
}
}
Each newTabMenu
item can hold any number of profiles, so add all the ones you want to the entries
list. Each item is a profile entry identified by their profile guid (e.g. {61a51b52-d731-4f48-86b2-bf8f96c30ea5}
)`.
Besides supporting the folder
type, entries in the newTabMenu
section can either be separator
(to draw a separator line between items) or remainingProfiles
, which will render all the profiles from your profile list that have not been rendered in the menu.
This is how it looks in action:
I really like the newTabMenu
feature and will keep experimenting with how to configure it best for my daily workflow.