Skip to content

Stop a normal quit from looking like 29 broken shells - #33

Merged
savvasioakeim merged 3 commits into
mainfrom
fix/shell-exit-noise
Oct 31, 2026
Merged

savvasioakeim merged 3 commits into
mainfrom
fix/shell-exit-noise

Conversation

@savvasioakeim

Copy link
Copy Markdown
Owner

Closing the app takes the backend down with it, so every shell reports an exit at the same moment. The frontend read each one as a crash and did what a terminal does: respawn. The backend was already gone, so the respawn failed, and after four failures in ten seconds each session wrote "The shell keeps exiting right after it starts" into its feed.

Those blocks are persisted history, so the next launch restored them and every project came up red. Running any command cleared it, which is why it read as cosmetic. 257 had accumulated.

What changed

  • beforeunload / pagehide set an unloading flag that stops the respawn entirely, so a normal quit or an update writes nothing.
  • statusOf returns idle for a project the user has not worked in this session: restored history is not this session's outcome, and touched already records that.
  • The note is not repeated when the last block is already the same note.

Also in here, unrelated but small: inline code chips were accent text on edge, which inverts between light and dark because the surface ramp runs in opposite directions. Contrast measured over all six themes went from 1.82 (default dark) and 1.56 (Sand) to 4.45 and 2.36 by moving the chip to well and the ink to accentFill.

Verification

Verified in a real build rather than under HMR, since the bug is in the quit path: the app opened and closed, the stored count stayed at 257 with nothing new written, and every project came up idle.

🤖 Generated with Claude Code

Closing the app takes the backend with it, so all 29 shells report an exit
at the same moment. The frontend read each one as "the shell died" and did
what a terminal does: start it again. The backend was already gone, so the
respawn failed, and after four failures in ten seconds the session wrote
"The shell keeps exiting right after it starts" into its feed.

That message is right for the case it was written for, a broken profile
that really does kill the shell on startup. It was wrong here: the shell
was fine, the app was quitting. One quit produced one block per project,
and the blocks are persisted history, so the next launch restored them and
every project came up red. Running any command cleared it, which is why it
looked cosmetic. 257 of them had accumulated.

Three changes. `beforeunload`/`pagehide` set an `unloading` flag that stops
the respawn entirely, so the message is no longer written on a normal quit
or an update. `statusOf` returns idle for a project the user has not worked
in this session, because restored history is not this session's outcome and
`touched` already recorded exactly that. And the note is not repeated when
the last block is already the same note.

Verified in a real build rather than under HMR: the app opened and closed,
and the stored count stayed at 257 with nothing new written, while every
project came up idle.
A chip was accent text on `edge`. On a dark window edge is the lightest
surface we have, so the chip stood out; on a light one it is the darkest,
which is how `resultUrl` ended up as mid-tone text on a mid-tone grey. The
same two class names produced opposite results because the surface ramp
runs in opposite directions.

Measured over all six themes, accent on edge: 1.82 on our default dark and
1.56 on Sand, where a chip is meant to be read. Moving the chip to `well`
and the ink to `accentFill` gives 4.45 and 2.36. `accentFill` is the accent
itself on a dark theme, so nothing changes there beyond the surface; on a
light one it is the deeper accent the filled controls already use, which is
also the consistent choice.
@savvasioakeim
savvasioakeim merged commit 129f156 into main Oct 31, 2026
3 checks passed
@savvasioakeim
savvasioakeim deleted the fix/shell-exit-noise branch October 31, 2026 18:28
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant