fix: normalize Windows cmd stdin newlines
This commit is contained in:
@@ -1186,6 +1186,10 @@ function buildWindowsCmdStdinLauncherScript(cwd: string | null): string {
|
||||
"$env:PYTHONUTF8 = '1';",
|
||||
"$env:PYTHONIOENCODING = 'utf-8';",
|
||||
"$script = [Console]::In.ReadToEnd();",
|
||||
"$script = $script -replace \"`r`n\", \"`n\";",
|
||||
"$script = $script -replace \"`r\", \"`n\";",
|
||||
"$script = $script -replace \"`n\", \"`r`n\";",
|
||||
"if (-not $script.EndsWith(\"`r`n\")) { $script += \"`r`n\" }",
|
||||
"if ([string]::IsNullOrWhiteSpace($script)) { [Console]::Error.WriteLine('ssh win cmd requires a command line or stdin batch script'); exit 2 }",
|
||||
`$prefix = ${powerShellSingleQuote(`${prefixLines.join("\r\n")}\r\n`)};`,
|
||||
"$temp = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), ('unidesk-win-cmd-' + [guid]::NewGuid().ToString('N') + '.cmd'));",
|
||||
|
||||
Reference in New Issue
Block a user