Repository navigation
Wait for the keypress ourselves instead of asking gum to - #8082
Merged
Merged
Conversation
gum 2.0 runs a spun command without the terminal attached, so the `gum spin -- read -n 1` that held the presentation terminal open returned at once. Every menu command that ended in a failure took its window down with it before the error could be read, which is how a failed update looked like a terminal that just quit. Read the key directly. gum's own terminal query replies are still sitting on the tty when the spinner stops, so drain those first or they answer the prompt on the user's behalf. The green dot reads better than the globe did, so the provisioning notice uses it too and drops its spinner along the way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The /dev/tty node is there whether or not a terminal is behind it, so the existence check passed on a headless run and left both reads failing with "No such device or address". Open it instead. Prompt on the terminal too, rather than stdout: a caller that redirects us was sending the prompt to a file while the read waited on the terminal, which looks like a hang with no instruction on screen. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
omarchybot
pushed a commit
that referenced
this pull request
Aug 24, 2026
…8082) Backport of the keypress fix (PR #8082, merged to quattro as 5d3299f) onto the v4-0-1 release branch. gum 2.0 runs a spun command without the terminal attached, so the gum spin -- read -n 1 that held the presentation terminal open returned at once. Every menu command that ended in a failure took its window down with it before the error could be read, which is how a failed update looked like a terminal that just quit. Read the key directly. gum's own terminal query replies are still sitting on the tty when the spinner stops, so drain those first or they answer the prompt on the user's behalf. The /dev/tty node is there whether or not a terminal is behind it, so open it rather than test for it -- the existence check passed on a headless run and left both reads failing with "No such device or address" -- and prompt on the terminal rather than stdout, so a caller that redirects us does not leave the user waiting on a prompt they were never shown. The green dot reads better than the globe did, so the provisioning notice uses it too and drops its spinner along the way. Clean cherry-pick: both files are byte-identical to quattro, so merging v4-0-1 into quattro resolves without a conflict. Exercised against the installed gum 2.0.0: headless it exits 0 at once, and on a pty it prints the prompt and returns on one keypress. test/shell (186 files) and test/cli pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
Closed
nick1udwig
pushed a commit
to nick1udwig/omarchy
that referenced
this pull request
Sep 9, 2026
* Wait for the keypress ourselves instead of asking gum to gum 2.0 runs a spun command without the terminal attached, so the `gum spin -- read -n 1` that held the presentation terminal open returned at once. Every menu command that ended in a failure took its window down with it before the error could be read, which is how a failed update looked like a terminal that just quit. Read the key directly. gum's own terminal query replies are still sitting on the tty when the spinner stops, so drain those first or they answer the prompt on the user's behalf. The green dot reads better than the globe did, so the provisioning notice uses it too and drops its spinner along the way. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Ask the terminal for itself before prompting on it The /dev/tty node is there whether or not a terminal is behind it, so the existence check passed on a headless run and left both reads failing with "No such device or address". Open it instead. Prompt on the terminal too, rather than stdout: a caller that redirects us was sending the prompt to a file while the read waited on the terminal, which looks like a hang with no instruction on screen. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gum2.0 runs a spun command without the terminal attached, so thegum spin -- bash -c 'read -n 1 -s'thatomarchy-show-donerelied on returns immediately instead of waiting for a keypress.Every command launched through
omarchy-launch-floating-terminal-with-presentationends inomarchy-show-done, so the pause at the end of those terminals is simply gone. When the command succeeds that is mostly invisible — something else usually prompts. When it fails, the window takes the error down with it, which is how a failed update looks like a terminal that just quits before anything can be read.Measured in a foot window on gum 2.0.0:
read -n1 -s -t 6gum spin --spinner globe --title "Done!" -- bash -c 'read -n 1 -s'The
scriptlogging wrapper inomarchy-updateis not involved — the spinner returns instantly with or without it.The fix
Read the key directly instead of asking gum to. Three details this has to get right:
/dev/tty, leaving a terminal that looks hung with no instruction./dev/ttyis opened rather than tested with-e. The device node exists whether or not a terminal is behind it, so a headless run (cron, systemd, ssh without-t) would pass an-echeck and then fail both reads with "No such device or address".The green dot reads better than the globe did, so
omarchy-provision-owner'snotice()picks it up too and drops its spinner along the way. Those were the only twogum spinsites in the repo.Verification
omarchy-show-doneholds until a keypress is injected, then returns rc=0. Before the fix the same harness returned in 0s.setsid, no controlling terminal): exits 0, silently.test/cli: 116 ok, 0 failures.🤖 Generated with Claude Code