fix: 改进 Windows SSH PowerShell 错误提示

This commit is contained in:
Codex
2026-07-11 06:23:13 +02:00
parent d810e854f0
commit ecd6764931
4 changed files with 59 additions and 8 deletions
+5
View File
@@ -24,6 +24,7 @@ import {
sshRuntimeTimeoutMs,
sshRuntimeTimingHint,
sshWindowsPlaneHint,
sshWindowsPowerShellPipelineHint,
wrapSshRemoteCommand,
type SshCaptureResult,
} from "./ssh";
@@ -435,6 +436,8 @@ async function runRemoteSshWebSocket(
if (!timedOut) {
const windowsPlaneHint = sshWindowsPlaneHint(invocation, code, stderrTail);
if (windowsPlaneHint) process.stderr.write(windowsPlaneHint);
const pipelineHint = sshWindowsPowerShellPipelineHint(invocation, code, stderrTail);
if (pipelineHint) process.stderr.write(pipelineHint);
}
const timingHint = formatSshRuntimeTimingHint(sshRuntimeTimingHint({
invocation,
@@ -615,6 +618,8 @@ async function runRemoteSshWebSocketCaptureRemoteCommand(
startedAtMs,
}));
if (timingHint) stderr += timingHint;
stderr += sshWindowsPlaneHint(invocation, code, stderr);
stderr += sshWindowsPowerShellPipelineHint(invocation, code, stderr);
resolve({ exitCode: code, stdout, stderr });
};
const openTimer = setTimeout(() => {