t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Windows desktop app abruptly quits on closing last tab with Ctrl+W; align behavior with macOS via System Tray

Open SXP-Simon opened this issue 2 months ago • 6 comments

Summary

On Windows (installed via .exe), pressing Ctrl+W when no editor tabs or terminals are open (or closing the last remaining tab) abruptly terminates the entire desktop application process without any confirmation or warning.

Motivation & Context

  • Discrepancy with macOS: On macOS, closing windows via Cmd+W leaves the application active in the Dock / Tray, which allows reopening or restoring the application without terminating the background process.
  • Accidental Closure: In Windows editor workflows, users frequently hit Ctrl+W to close tabs in succession. When the last tab closes, Ctrl+W directly kills the entire app and drops running background processes.
  • Dedicated Exit Mechanism: T3 Code already provides a deliberate double Ctrl+Q gesture to exit the application cleanly.

Proposed Solution

  1. Introduce native System Tray support on Windows with a context menu (Open / Quit) and click/double-click activation.
  2. Update DesktopLifecycle to keep the background process alive on Windows upon window-all-closed, mirroring the macOS experience.

I have prepared a PR to address this cleanly.

SXP-Simon avatar Sep 05 '26 16:09 SXP-Simon

Related: pingdotgg/t3code#11069 adds File → New Window and ⌘N / Ctrl+N to reopen or focus the main window, addressing the macOS reopening problem reported in pingdotgg/t3code#435.

It leaves Windows/Linux last-window-close behavior unchanged, so it does not resolve this issue or add tray support. Keeping the host alive after closing its last window would still need a separate change.

angusm73 avatar Sep 10 '26 11:09 angusm73

The same issue also occurs on Linux: pressing Ctrl+W closes the entire application without any warning or confirmation.

kaaboaye avatar Sep 16 '26 20:09 kaaboaye

+1 on this one, very much needed

dannyfranca avatar Sep 27 '26 16:09 dannyfranca

Where this stands on main (f7f9e21785), for anyone following:

  • On Windows and Linux, closing the last window quits the app, and so does Ctrl+W when there's nothing left to close. Quitting stops the bundled server and any desktop-managed WSL backend, so running agent turns stop with it. Ctrl+Q has the hold/double-press guard; the close button and Ctrl+W don't.
  • Five tray PRs were closed unmerged: #7493, #8423, #10162, #10163, #19176. None was turned down on the idea. They closed for missing design approval, missing evidence, or because another PR replaced them.
  • The open question is the one in #10697: hide to tray, or confirm before closing while work is running. That needs a decision here or in an Ideas discussion before another PR is worth opening.
  • t3 service install supports Linux and macOS only, so on Windows the way to keep agents running without the window today is a separate t3 serve with its own T3 home.

Posted by Claude Opus 5.5 for @SunkenInTime.

SunkenInTime avatar Oct 20 '26 19:10 SunkenInTime

[!NOTE] 🤖 Claude Opus 5.5 responding on behalf of Theo

Closing: this is covered by #25860, which landed. Reopen if an important part is still missing.

t3dotgg avatar Oct 31 '26 11:10 t3dotgg

The X button still quits T3 Code on Windows (and Linux), which stops the bundled server and every running agent turn with no warning. #25860 fixed Ctrl+W, but the close button, the main part of this issue, still does it. macOS keeps the app running with no window. Could this be reopened?

A minimal version that covers it: closing the last window hides it to a tray icon (Open / Quit) instead of quitting, with a setting to turn that off and an optional start-at-login. I've been running exactly that locally on Windows and it works well.

Stickman803 avatar Nov 25 '26 20:11 Stickman803