Terminal: Allow dropdown menu customization in profiles.json

Created on 25 Jun 2019  路  7Comments  路  Source: microsoft/terminal

We'll probably need a settings redesign that allows you to specify the contents of the menu instead of adding a new profile type.


original content

Summary of the new feature/enhancement

Allow MenuFlyoutSeparatorto be programmed in profiles.json

Proposed technical implementation details (optional)

My thoughts are to have a flag that allows a "profile" in the profiles.json to be interpreted as a MenuFlyoutSeparatorin App::_CreateNewTabFlyout()

Area-Settings Help Wanted Issue-Feature Product-Terminal

Most helpful comment

(directly including the request from #2330 here cause it's a great idea)

Right now I have 5 profiles I use. I just played a bit with adding a ssh-profile and it works fine. But when I want to add all the profiles I have in Putty in WT I need to add another 20+ ssh-profiles. This means the list is going to be really long.

So being able to make submenus and put my profiles in a multiple submenus would be much welcomed.

Initially the menu looks like this:

PowerShell
CMD
WSL
SSH-Group1 > 
SSH-Group2 > 

When a submenu is selected, something like this

PowerShell
CMD
WSL
SSH-Group1 >
SSH-Group2 > +--------+
             | Host 1 |
             | Host 2 |
             | Host 3 |
             +--------+

All 7 comments

We'll probably need a settings redesign that allows you to specify the contents of the menu instead of adding a new profile type.

I'm just gonna mark this as out of scope for 1.0. :smile:

(directly including the request from #2330 here cause it's a great idea)

Right now I have 5 profiles I use. I just played a bit with adding a ssh-profile and it works fine. But when I want to add all the profiles I have in Putty in WT I need to add another 20+ ssh-profiles. This means the list is going to be really long.

So being able to make submenus and put my profiles in a multiple submenus would be much welcomed.

Initially the menu looks like this:

PowerShell
CMD
WSL
SSH-Group1 > 
SSH-Group2 > 

When a submenu is selected, something like this

PowerShell
CMD
WSL
SSH-Group1 >
SSH-Group2 > +--------+
             | Host 1 |
             | Host 2 |
             | Host 3 |
             +--------+

I was just about to create a new ticket when I stumbled upon this one. I wish to add "mee too" on this - it's very important to a subgroup of the Terminal power-users - namely the administrators. Currently we are using MobaXTerm which does a wonderful job at storing 100s of distinct host entries (profiles) each with their own access and communication parameters. On MacOS we have a toolbar menu and on Linux simply a very large aliases file. In Terminal, I'd love to see this change:

Instead of doing like this:

"profiles":
    [
        {
            "guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee0}",
            "hidden": false,
            "name": "Company 1, Server X",
            "commandline": "ssh [email protected]",
        },
        {
            "guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee1}",
            "hidden": false,
            "name": "Company 1, Server Y",
            "commandline": "ssh [email protected]",
        },
        {
            "guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee2}",
            "hidden": false,
            "name": "Company 2, Server X",
            "commandline": "ssh [email protected]",
        },
        {
            "guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee3}",
            "hidden": false,
            "name": "Company 2, Server Y",
            "commandline": "ssh [email protected]",
        },
        {
            "guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee4}",
            "hidden": false,
            "name": "PowerShell 7 Preview",
            "source": "Windows.Terminal.PowershellCore"
        }
    ],

I would rather like to do (something like) this:
```json
"profiles":
[
{
"folder": "Company 1",
"items": [
{
"guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee0}",
"hidden": false,
"name": "Server X",
"commandline": "ssh [email protected]",
},
{
"guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee1}",
"hidden": false,
"name": "Server Y",
"commandline": "ssh [email protected]",
}
]
},
{
"folder": "Company 2",
"items": [
{
"guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee2}",
"hidden": false,
"name": "Server X",
"commandline": "ssh [email protected]",
},
{
"guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee3}",
"hidden": false,
"name": "Server Y",
"commandline": "ssh [email protected]",
}
]
},
{
"guid": "{aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee4}",
"hidden": false,
"name": "PowerShell 7 Preview",
"source": "Windows.Terminal.PowershellCore"
}
],
````

Which would help very much in organizing and accessing a configuration with tens or hundreds of defined servers and several companies/categories of servers.

I would propose something like this

{
    "profiles": {
        "defaults": {},
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "Command Prompt",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
                "hidden": false,
                "name": "Debian",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "name": "Company Project 1",
                "hidden": false,
                "defaults": {
                    // Put settings here that you want to apply to all profiles in 'Company Project 1'.
                    // Proposal - inherit from parent "defaults"
                },
                "list": [
                    {
                        "guid": "{a3a2e83a-884a-5379-baa8-16f193a13b21}",
                        "hidden": false,
                        "name": "PowerShell 7 Preview",
                        "source": "Windows.Terminal.PowershellCore"
                    },
                    {
                        "commandline": "nu.exe",
                        "guid": "{2b372ca1-1ee2-403d-a839-6d63077ad871}",
                        "hidden": false,
                        "name": "Nu Shell",
                    },
                    {
                        "commandline": "elvish.exe",
                        "guid": "{6ddf0352-a8c2-46c3-9734-0034762b954c}",
                        "hidden": false,
                        "name": "Elvish"
                    }
                ]
            }
        ]
    }
}

By doing so each group/folder will pretty much be like "profiles" section containing defaults (which will be inherited hierarchically) and "list" of profiles.

We can have groups inside of groups.

Forked repo, implementing it in my fork

Partial (working) implementation exists in this branch. Branch is bit lagging from master.

I'll add another 'me too' for this one - and a twist... I'd like to be able to reference one or more external files for my 'profiles.list' section. My need is similar to several examples above, but I'd like to be able to share 'customer' folders with other users without having to share out my entire configuration (and, since I have the information I need in a database already, I'd like to generate this JSON from there instead of having to edit it manually)

Was this page helpful?
0 / 5 - 0 ratings