From 8c1b36fce7ce50cc24eb44d01b30ac97afbba329 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Mon, 23 Nov 2026 08:07:11 -0800 Subject: [PATCH 1/3] fix(desktop): an early stop signal no longer unmounts the AppImage under t3 Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/app/DesktopCliShim.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/app/DesktopCliShim.ts b/apps/desktop/src/app/DesktopCliShim.ts index 0f7e605da6b36..58120675b8151 100644 --- a/apps/desktop/src/app/DesktopCliShim.ts +++ b/apps/desktop/src/app/DesktopCliShim.ts @@ -119,11 +119,16 @@ export const renderCliShim = (input: { // Ctrl-C to the CLI directly. A background child would read /dev/null, so pass stdin on fd 9. // With stdin closed, `exec 9<&0` would end the shell; `command` makes it a normal error. "{ command exec 9<&0; } 2>/dev/null || exec 9/dev/null; else stop=TERM; fi' TERM`, + `trap 'if [ -n "$cli" ]; then kill -HUP "$cli" 2>/dev/null; else stop=HUP; fi' HUP`, `${run("$mount")} <&9 9<&- &`, "cli=$!", "exec 9<&-", - `trap 'kill -TERM "$cli" 2>/dev/null' TERM`, - `trap 'kill -HUP "$cli" 2>/dev/null' HUP`, + '[ -z "$stop" ] || kill -"$stop" "$cli" 2>/dev/null', "trap '' INT", "status=0", 'wait "$cli" || status=$?', From 4710391c45a678901f31fa5924e6e2ff859bf4a0 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Mon, 23 Nov 2026 08:09:33 -0800 Subject: [PATCH 2/3] fix(desktop): Ctrl-C right after start no longer unmounts the AppImage either Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/app/DesktopCliShim.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/DesktopCliShim.ts b/apps/desktop/src/app/DesktopCliShim.ts index 58120675b8151..80e61464a934e 100644 --- a/apps/desktop/src/app/DesktopCliShim.ts +++ b/apps/desktop/src/app/DesktopCliShim.ts @@ -125,11 +125,12 @@ export const renderCliShim = (input: { "stop=", `trap 'if [ -n "$cli" ]; then kill -TERM "$cli" 2>/dev/null; else stop=TERM; fi' TERM`, `trap 'if [ -n "$cli" ]; then kill -HUP "$cli" 2>/dev/null; else stop=HUP; fi' HUP`, + // A no-op, not '': the CLI would inherit an ignored SIGINT. + "trap ':' INT", `${run("$mount")} <&9 9<&- &`, "cli=$!", "exec 9<&-", '[ -z "$stop" ] || kill -"$stop" "$cli" 2>/dev/null', - "trap '' INT", "status=0", 'wait "$cli" || status=$?', // A trapped signal interrupts wait; wait again for the CLI's own exit status. From 77443384848cf68882c148ea521b5e7cf1555f2e Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Mon, 23 Nov 2026 08:13:27 -0800 Subject: [PATCH 3/3] fix(desktop): explain the launcher's INT trap Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/app/DesktopCliShim.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src/app/DesktopCliShim.ts b/apps/desktop/src/app/DesktopCliShim.ts index 80e61464a934e..0358849840ddd 100644 --- a/apps/desktop/src/app/DesktopCliShim.ts +++ b/apps/desktop/src/app/DesktopCliShim.ts @@ -125,7 +125,7 @@ export const renderCliShim = (input: { "stop=", `trap 'if [ -n "$cli" ]; then kill -TERM "$cli" 2>/dev/null; else stop=TERM; fi' TERM`, `trap 'if [ -n "$cli" ]; then kill -HUP "$cli" 2>/dev/null; else stop=HUP; fi' HUP`, - // A no-op, not '': the CLI would inherit an ignored SIGINT. + // Ctrl-C goes to the CLI directly; the launcher stays to unmount after it exits. "trap ':' INT", `${run("$mount")} <&9 9<&- &`, "cli=$!",