Repository navigation
End omarchy update when its terminal closes at a prompt (4.5) - #18933
Conversation
* End omarchy update when its terminal closes at a prompt * Record the update lock acquiring PID for diagnostics --------- Co-authored-by: Tobi Lutke <tobi@shopify.com> (cherry picked from commit 9ac0883)
[Medium impact] The changes affect interrupted updates and diagnostics for the shared update lock. The runtime changes appear sound, but the new tests must join the existing update suite before merging to satisfy the repository's rule. Findings
SummaryThis backport keeps a plain Bash shell above the updater so losing the terminal can end a waiting prompt and release its update lock.
No tests were executed during this review. Acknowledgments: ryanrhughes explicitly describes the earlier hangup during package steps and the removal of zsh/fish startup-file loading as intentional. Neither is reported as a defect.
|
| source "$(dirname "$0")/base-test.sh" | ||
| source "$SHELL_TEST_DIR/fixtures/sudo-boundary-test.sh" |
There was a problem hiding this comment.
This file adds a separate suite for omarchy-update, although test/shell.d/update-lock-test.sh already tests that command and its lock. AGENTS.md requires extending the area's existing test file rather than adding a new *-test.sh. Move these checks into the existing suite before merging, keeping the private terminal and process cleanup.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Backports #16045 to 4.5.1. It fixes #16044: if the terminal running
omarchy updategoes away while it's waiting at "Continue with update?", the updater andgumcan stay alive for days and keep holding the update lock, so later updates report "An Omarchy update is already running." It has been reported several times on 4.x installs, including one that lasted almost seven days.omarchy-updatenow runs itself insidescriptwith; exit $?after the command. That keeps a plain Bash with no signal traps as the terminal session's leader. When the terminal is lost, that shell exits and the kernel sends the hangup on to the prompt. Before, the updater was the leader, and its HUP/TERM traps waited on the prompt, which never got the hangup.omarchy-update-lockalso records the PID that took the lock and prints it when a second update is turned away. That PID is only for diagnostics;flockstill decides who holds the lock.This is a cherry-pick of
9ac08836cffrom #16045. All four files match that commit byte for byte, and the files it changes were identical onv4-5-1andquattrobefore it. On this branch these pass:update-hangup,update-lock,update-user-path,update-sequence,update-hook-securityandupdate-stay-awake-security.Scope and risk
Only
omarchy updateruns and the update lock are affected. Closing the terminal during a package step now sends that step a hangup about a second after the terminal closes. On 4.5.1 it already got one about 2–3 seconds later, whenscriptgives up on its child. The one new case is whenscriptitself vanishes, which is the bug being fixed.scriptnow always runs the command with Bash and passes the caller'sSHELLthrough unchanged. A user whose login shell is zsh or fish no longer has~/.zshenvorconfig.fishsourced into the update.🤖 Generated with Claude Code