Open ctrueden opened 9 months ago
OK, so I guess the solution is to:
'
symbols in each argument with ''
to escape them.'
) symbols.This should cover all the quoting cases for PowerShell.
Of course, then the dry-run output won't work in Command Prompt anymore... but I'm not sure we can have it both ways. Not unless there is a way to check the type of the attached console.
Probably will be sufficient to check an environment variable like WT_SESSION
, which should be set for PowerShell, but typically unset for Command Prompt. See this SO answer for elaboration.
In my hands WT_SESSION
and WT_PROFILE_ID
are defined iff running in Windows Terminal, regardless of whether it's PowerShell or cmd.exe.
(I personally think it's okay to not support the cmd.exe case here.)
The
--dry-run
output on Windows works in Command Prompt, but not PowerShell, because PowerShell gets weird about unquoted arguments with the dot (.) symbol. Should the Windows--dry-run
put double quotes around each argument?