You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal shortcuts can reopen the drawer on a terminal that is still closing #27
The new-terminal and split shortcuts can open the drawer on a terminal that is still closing. That terminal then disappears once its close finishes.
Found in review of #26. Not reproduced in the app.
When it happens
All of these must hold:
terminal.new, terminal.split or terminal.splitVertical is bound without when: "terminalFocus". The defaults (mod+n, mod+d) have that condition, so they never reach this path with the drawer closed.
The drawer is closed and the thread has no terminals.
The shortcut fires before the server finishes closing the thread's last terminal, which is within one round trip of the close.
Cause
The shortcuts open the drawer with openTerminalIfClosed in apps/web/src/components/chat/useChatTerminalActions.ts, which calls setTerminalOpen(true). On an empty drawer the store fills in term-1 without checking closingTerminalIds. The terminal button avoids this: toggleTerminalVisibility skips ids that are still closing.
While the close is in flight the server still lists term-1, so the drawer records it. When the close lands, the server drops it, and the drawer closes the new term-1 as closed elsewhere.
Suggested fix
On a closed, empty drawer, have the shortcuts open it through toggleTerminalVisibility, as the button does.
I tried this in the real app with a scenario that matches the steps above: a New Terminal rule without when: "terminalFocus", and a shell that ignores SIGHUP, so the server takes its full 1 s grace period to close it. The shortcut was pressed right after Confirm, while the old terminal was still closing.
Activity
viktorce commentedon Nov 19, 2026
Closing as a duplicate of #22, which #26 fixes.
I tried this in the real app with a scenario that matches the steps above: a New Terminal rule without
when: "terminalFocus", and a shell that ignores SIGHUP, so the server takes its full 1 s grace period to close it. The shortcut was pressed right after Confirm, while the old terminal was still closing.main(e37e45fd5b) the shortcut leaves the drawer closed. That is the Terminal button needs two clicks after the terminal was closed #22 bug: the store still liststerm-1as seen on the server.e11750a4f6) the drawer opens with one fresh shell and stays open.The code path described above is still there, but it has no visible effect once #26 is in. Only New Terminal on a local connection was tested.