Allow custom dynamic profile generator sources #7805
Labels
Issue-Feature
Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Resolution-Duplicate
There's another issue on the tracker that's pretty much the same thing.
Description of the new feature/enhancement
A plug and play approach to dynamic profiles. This would allow people who want profiles generated dynamically to easily do so. Instead of Windows Terminal having to support lots of dynamic profile generators that different users suggest with lots of configuration options, users could create them themselves and possibly share via git. I tried searching to see if this was already suggested and was surprised it wasn't. If an issue already does exist and I just missed it then I apologize. Currently, there isn't even a way to easily script editing the settings file. Here are a few use cases:
Docker
One example use case is if someone wanted a dynamic profile for all docker containers that are currently running or maybe all containers regardless of whether they are running or not. This would address #4892 without locking in everyone to the same command. Some people may want volumes to be included while others may want to exec into the container without modifying it at all. Some may want to pass in specific environment variables or something. Point is, it would be customizable.
Customizing WSL profiles
Instead of the built in
Windows.Terminal.Wsl
generator, someone may want to allow specifying a different shell (commandline) or to pass in extra flags, etc. This would also address #5571 which does mention dynamic profiles as plugins.SSH
If a user wants to dynamically generate profiles that directly ssh into other machines based off
~/.ssh/known_hosts
. CUrrently, these can easily be added manually and look something like this:Or if someone prefers to use ssh from WSL2 distro instead of openssh (Not sure if there is any advantage),
Proposed technical implementation details (optional)
My suggestion would be to add another top-level section that is an array of objects containing the source name and a script for generating profiles. Maybe this script is required to be a powershell or bash script with functions that match specific names. Maybe this script is allowed to be any language as long as it is executable. Perhaps it is required to be written in c and adhere to the
IDynamicProfileGenerator.h
that already exists. I am not sure whether it would be better for the script plugin to output json array that gets merged into the list of profiles automatically or whether it should just output list of names and guids and then have a second call based onsource
that actually determines what should happen for that profile which is what the existing dynamic profiles do. For exampleThe text was updated successfully, but these errors were encountered: