From 1c12b44f2ce6ae91dda922259ef7930d0dfc7376 Mon Sep 17 00:00:00 2001 From: St0ff3l Date: Tue, 23 Jun 2026 11:52:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E7=95=99=20SSH=20=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E8=BF=9E=E6=8E=A5=E5=90=8E=E7=9A=84=E7=BB=88=E7=AB=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Codex --- .../services/sessions/shell-cwd-integration.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/apps/desktop/src/main/services/sessions/shell-cwd-integration.ts b/apps/desktop/src/main/services/sessions/shell-cwd-integration.ts index e254a4c..af1171e 100644 --- a/apps/desktop/src/main/services/sessions/shell-cwd-integration.ts +++ b/apps/desktop/src/main/services/sessions/shell-cwd-integration.ts @@ -88,18 +88,10 @@ export function findSetupEchoEnd(text: string): { lineStart: number; payloadEnd: const cwd = parseOsc7Payload(match7[1] ?? '') const user = matchUser ? matchUser[1] : null - // Try to find the prompt printed after the command to suppress it as well - const afterPayload = searchSlice.slice(payloadEnd - needleIndex) - const promptMatch = /^\s*([^\r\n]*[#$%>]\s*)/.exec(afterPayload) - - if (!promptMatch && text.length < 1024) { - // Wait for the prompt to arrive in the buffer - return null - } - - const finalPayloadEnd = payloadEnd + (promptMatch ? promptMatch[0].length : 0) - - return { lineStart, payloadEnd: finalPayloadEnd, cwd, user } + // Keep the real shell prompt visible. We only suppress the injected setup + // command echo and its OSC payload, so the prompt printed after execution can + // render naturally on first connect and later silent refreshes. + return { lineStart, payloadEnd, cwd, user } } function parseOsc7Payload(payload: string): string | null {