Pass a command line argument to the new terminal window that is about to be launched? #17521
-
I am trying to figure out how to launch new terminal window and pass a command line to be executed by the new terminals shell (PowerShell 7) The following works, a new terminal window, with Pwsh as its shell opens, and
But I want to choose what windows terminal profile to use for the new terminal window, rather than the generic Pwsh executable. I tried using
This causes windows terminal to show a dialog box with an error:
Running the following works just fine, the new window with the profile launches:
Is this even possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Alas, this is one of the weird parts of Profiles as implemented in Terminal today. The commandline passed on the command line (hah) is taken wholesale, and used to override the commandline of the profile you specify. Right now, that means you need to do this:
There's an issue somewhere tracking changing (or clarifying, or extending?) this behavior, but I can't find it at the moment. |
Beta Was this translation helpful? Give feedback.
Alas, this is one of the weird parts of Profiles as implemented in Terminal today.
The commandline passed on the command line (hah) is taken wholesale, and used to override the commandline of the profile you specify.
Right now, that means you need to do this:
There's an issue somewhere tracking changing (or clarifying, or extending?) this behavior, but I can't find it at the moment.