@devries-cameron20 / t3code Mirror · read-only / commits / 678f23a699
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 11:30 UTC

fix(desktop): restore second-press quit fallback (#9485)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

maria committed Sep 3, 2026 at 18:34 UTC 678f23a69943e3eef7171f452b44f2931d2ef21f
2 files changed +6 -8
apps/desktop/src/window/QuitHold.test.ts
+3 -3
@@ -368,14 +368,14 @@ describe("makeQuitShortcutHandler", () => {
368 expect(harness.notifications).toEqual([DOUBLE_CLICK_DOWN, UP, DOUBLE_CLICK_DOWN]);
369 });
370
371 - it("does not treat two quick presses as a quit in hold mode", async () => {
371 + it("quits on a quick second press in hold mode", async () => {
372 const harness = makeHarness();
373 await harness.send(makeInput({}));
374 await harness.send(makeInput({ type: "keyUp" }));
375 vi.advanceTimersByTime(QUIT_DOUBLE_PRESS_MS - 100);
376 await harness.send(makeInput({}));
377 - expect(harness.quit).not.toHaveBeenCalled();
378 - expect(harness.notifications).toEqual([HOLD_DOWN, UP, HOLD_DOWN]);
377 + expect(harness.quit).toHaveBeenCalledTimes(1);
378 + expect(harness.notifications).toEqual([HOLD_DOWN, UP]);
379 });
380
381 it("cancels the hold when another key interrupts it", async () => {
apps/desktop/src/window/QuitHold.ts
+3 -5
@@ -181,11 +181,9 @@ export function makeQuitShortcutHandler(
181 quitNow();
182 return;
183 }
184 - if (
185 - resolvedMode === "double-click" &&
186 - previousPressAt !== 0 &&
187 - now - previousPressAt <= QUIT_DOUBLE_PRESS_MS
188 - ) {
184 + // Keep a second press as an escape hatch when macOS misses the events
185 + // that would complete a hold.
186 + if (previousPressAt !== 0 && now - previousPressAt <= QUIT_DOUBLE_PRESS_MS) {
187 quitNow();
188 return;
189 }