Closed Firehawke closed 2 weeks ago
Thanks for the request!
You can sort of do this already, by using a matchProfiles
entry in the new tab menu (docs).
Here's what mine looks like:
"newTabMenu":
[
{
"type": "remainingProfiles"
},
{
"allowEmpty": false,
"entries":
[
{
"commandline": null,
"name": null,
"source": "Windows.Terminal.Wsl",
"type": "matchProfiles"
}
],
"icon": "ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png",
"inline": "never",
"name": "WSL",
"type": "folder"
}
],
In brief: it's two toplevel menu items, one that says "all unclaimed profiles go in the root" and one that says "now put some WSL profiles in a folder called WSL". All WSL profiles will go into the folder, and all non-WSL profiles will go into the root.
You can minimize it down to...
"newTabMenu": [
{ "type": "remainingProfiles" },
{
"entries": [ { "source": "Windows.Terminal.Wsl", "type": "matchProfiles" } ],
"name": "WSL",
"type": "folder"
}
],
It looks like this at runtime (for me):
(The ubuntu profile doesn't report as WSL, because Canonical Ltd created a new custom entry for it - you can use as many matchProfiles
entries as you need in a menu, though, to cover everything you want.)
Does that help?
FWIW, my actual new tab menu config looks like this:
At least for now that seems to be the best option we have. Thanks.
Description of the new feature/enhancement
Since Windows Terminal now supports setting up folders for profile groups, a setting to put WSL instances in a folder of your choice by default would be useful.
This came about when I started playing with nixos as a WSL2 instance; Windows Terminal found it by default as it should, but dumped it in the root folder so I'd have to edit the json to put it into the Linux folder where I keep my other WSL instances.
Proposed technical implementation details (optional)
A config setting in the JSON (and eventually in the UI as well, I know that's long-term as folders have almost no UI accessibility right now) to tell WT to put WSL2 imports in a specific folder by default. It's fine if the default starts off as the root as it is now; I can change it as needed after that point.