microsoft / microsoft/terminal

Passing a commandline to an elevate:true profile on the commandline doesn't separate args

Open
#12,597 1 comment 1 reaction 0 assignees View on GitHub
Area-Commandline Help Wanted Issue-Bug Priority-2 Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

(from a teams convo)

> I bet that
>
> ```
> wt --profile "Admin Cmd" -- cmd.exe /c D:\os\src\tools\razzle.cmd amd64fre developer_dir D:\Repos\developer\groups\jevansa no_opt
> ```
>
> would work

> ```[error 2147942402 (0x80070002) when launching `"cmd.exe /c D:\os\src\tools\razzle.cmd amd64fre developer_dir D:\Repos\developer\groups\jevansa no_opt"']```
> I ran: `wt --profile "Admin Cmd" -- cmd.exe /c D:\os\src\tools\razzle.cmd amd64fre developer_dir D:\Repos\developer\groups\jevansa no_opt`
>
> I think it's still trying to take the whole string and pass to CreateProcess. Is there a way to get it split up?

> it might be the fact that when you do have an `elevate:true` profile, we have to `CreateProcess` another terminal process, and I bet we're passing the whole bit after `--` as a single arg to the elevated wt

Contributor guide

Open the contributing guide

Research direction

Start with command-line argument handling for elevate:true profiles and the CreateProcess handoff to the elevated wt process. Reproduce the shown wt command and verify that the arguments after -- remain separated rather than being passed as one executable string; done means the cmd.exe command launches with its arguments intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.