Customizing and opening hidden profiles in Windows Terminal

The Windows Terminal Github page does not appear to provide the opportunity to ask "how-to" style questions, so I ask it here.

I have defined a new, hidden Powershell profile in my settings. My question is twofold:

  • How can I open a new Terminal tab with this new profile without "unhiding" it?
  • How do I ensure that a new tab opened with this hidden profile always has two terminal panes? I.e. two simultaneous command prompts split down the middle?

Thanks.


Opening Hidden Profiles

Profiles that are hidden from the drop-down can still be opened in (at least) one of two ways:

  • Via command-line such as wt -p "profile name". If you want to open it in an existing Windows Terminal, use "window 0", as in wt -w 0 -p "profile name".
  • Via the "newTab" action. You'll need to manually edit your settings.json to add the "profile" property to the "newTab" action. Open "Settings" and select "Open JSON File", then find the "actions" section. Add an action something like:
    {
        "command": 
        {
            "action": "newTab",
            "profile": "Profile Name"
        },
        "keys": "ctrl+shift+space"
    }
    

Note that the Command Palette's (ShiftShiftP) "New Tab" option will currently not show hidden profiles.

Splitting a profile when opened

A "split" can't be assigned directly to a profile, although the recent Preview release of Windows Terminal seems to be heading in that direction with the ability to save Window layouts (I haven't tried this yet to see how close it comes).

However, using one of the two techniques above to open the profile, you should be able to add the split by:

  • Creating a script (e.g. .cmd or .ps1) with the command-line mentioned above plus the split-pane command.
  • Using a "multipleActions" action to open the profile and then perform the split via a keybinding. You'll currently need the latest Preview Release (available from the Microsoft Store) in order to use this feature.