Repository navigation
Conversation
gum confirm never opts into mouse events, so clicking Yes in the floating update terminal did nothing. fzf already accepts left-click.
Automated AI review
Verified: the mouse part works as described. In a terminal emulation using foot's mouse encoding, a single left click on "Yes" returns 0 and on "No" returns 1, clicks on the header or blank rows are ignored, and the result holds through Four behaviour issues were reproduced with real fzf 0.74.3 in a pseudo-terminal. The first two affect the two prompts this PR changes. Keys that answered
|
| Variant | Answered Yes |
|---|---|
Head helper, start:pos(2) |
23 of 30 runs; 34 of 40 runs (separate test harnesses) |
Head helper changed to load:pos(2) |
0 of 20 runs |
In the observed runs, the highlighted row before Enter matched the answer, so the wrong default is visible, not an early-keypress artifact.
Impact: the two callers in this PR use the default (Yes), so they are not affected. The helper advertises --default=false in its usage text and examples ("Remove orphans?"), and most of the six existing gum confirm --default=false sites guard removals, such as orphan packages (in the same update flow), VM data and AI data. Migrating them to the helper as it stands would make Yes the effective default most of the time.
Suggested change: use --bind "load:pos($start_pos)" (verified above) or add --sync.
A user's FZF_DEFAULT_OPTS changes the answer
fzf applies FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS before the helper's arguments, and the helper does not clear them. Observed with Enter on the default row: --tac returns 1 (No), --print-query makes Yes return 1, and --no-mouse disables mouse reporting.
Impact: only affects users who export these variables into the terminal's environment; Omarchy does not set them. gum confirm had no comparable exposure.
Suggested change: run fzf with FZF_DEFAULT_OPTS= FZF_DEFAULT_OPTS_FILE= (verified on a copy: all tested cases then answer correctly).
Optional test improvement: test/shell.d/confirm-test.sh uses an fzf stub that accepts any arguments. A copy of the helper with --info=hidden changed to --info=bogus still passes all assertions, while real fzf rejects it and every update would be cancelled. The --default=false check asserts the start:pos(2) string, which is the unreliable construct above. Running at least one case against real fzf, when it is installed, would catch both. Setting HOME to the test's temp directory would also stop the test from reading the runner's own theme file.
Review information
Test scope: source review of the PR, its callers and the update flow, plus fzf 0.74.3, gum and foot 1.28.0 source and the omarchy-pkgs omarchy PKGBUILD. Sandboxed pseudo-terminal runs used real fzf with scripted keys and foot-format mouse reports, with a synthetic home directory. Reboot, shell restart and package commands were stubbed, and omarchy update itself was not run. No click-through was performed in a live foot window or other terminal, and the rate of the --default=false race on a real terminal was not measured.
AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted cross-checks of each other's findings, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
Keep y, n, and q working, select the default row after fzf has loaded the list, ignore FZF_DEFAULT_OPTS, fall back to gum confirm when fzf is missing, and report a real fzf failure instead of a cancel.
|
Thanks for the review. The four behavior findings were right, and they are in 313900a.
I did not add fzf to the The stub test covers the binds, the cleared environment, a non-130 failure, and the gum fallback. When fzf and python3 are installed it also drives a real fzf for |
Automated AI review
Follow-up on 313900a. The four behaviour issues from the earlier review are fixed, as described in the author's reply. The same commit introduced a file-mode change that breaks the helper in a checkout, a lint failure in Verified with real fzf 0.74.3 in a pseudo-terminal, on an executable copy of the helper (see the first finding below):
The new real-fzf test block catches most of the earlier test gaps: it fails on
|
| Key | Head | Head with --sync |
gum confirm (20 runs) |
|---|---|---|---|
n |
Yes in 4 | all correct | all correct |
q |
Yes in 3 | all correct | all correct |
y |
No in 73, each with fzf failed (exit 1) |
all correct | all correct |
Impact: only affects a key typed before the prompt appears, for example n pressed while the "Ready to update?" box is being drawn. In the runs above, where the key was already typed before the helper started, n or q started the update or reboot in 3 to 4 percent of cases. Keys pressed after the rows are drawn behave correctly, and gum confirm had no such race.
Suggested change: add --sync to fzf_args, so fzf starts only after the input and load actions have completed. With it, the key, mouse, default-row and fallback checks gave the same results as without it. An earlier 60-run sample with --sync had one miss (y answered No).
Conflict with current quattro
GitHub reports a merge conflict between this branch and quattro. bin/omarchy-update-restart conflicts because #9467 (merged 2026-09-25) added an unattended guard to confirm_reboot:
confirm_reboot() {
if [[ ${OMARCHY_UPDATE_UNATTENDED:-0} == "1" ]]; then
echo "$1 Run omarchy-system-reboot when ready."
elif omarchy-confirm "$1"; then # this PR's change, applied to the quattro version
omarchy-system-reboot
exit 0
fi
}Impact: taking this PR's version of the function as is would drop the unattended guard, so omarchy update -y would prompt whenever a reboot is due.
Suggested change: resolve as above. On a local merge with the executable bit restored, the PR test passed, --reboot-only rebooted (stubbed) on y and not on n, and the unattended path printed the message without prompting. quattro now also has a skip test helper, which fits pass "real fzf keyboard check skipped" better after a rebase.
Optional: gum also toggles with h, l and Shift-Tab. These are unbound here, so l then Enter answers Yes, while gum's source toggles to No on l (the highlight does not move). Binding them, for example h:up,l:down,btab:up (not tested), would match gum. The comment above the status check says Esc gives 130 like gum, but gum 2.x exits 1 on Esc (only Ctrl-C gives 130). Callers treat both the same.
Optional test improvement: the real-fzf block waits with os.waitpid(pid, 0) and no timeout. Run against the previous helper, or with the y/n/q binds removed, it hangs until killed (60 s in these runs) instead of reporting not ok. A deadline loop with os.WNOHANG that kills the child on expiry (not tested) should make it fail cleanly.
Review information
Test scope: follow-up at 313900a against the earlier findings, plus the new commit and its interaction with current quattro. Source review of the diff and callers, gum 2.0.2 and fzf 0.74.4 source, and the omarchy-pkgs PKGBUILDs. Sandboxed pseudo-terminal runs used real fzf 0.74.3 and gum 2.0.0 with scripted keys, synthetic mouse reports and a synthetic home directory. Reboot and shell restart were stubbed, and behaviour tests used an executable copy of the helper, with the committed mode tested separately. omarchy update was not run, no live terminal was clicked through, and the typeahead rate on a real terminal was not measured.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
Keep quattro's unattended reboot guard and ask through omarchy-confirm, so omarchy update -y does not start prompting again.
Restore the executable bit, probe fzf with omarchy-cmd-present, and start fzf with --sync so a key typed while the prompt opens cannot accept the wrong row. h, l, and Shift-Tab toggle like gum.
|
Thanks for rechecking 313900a. The four earlier behaviour fixes stay. Taken in 74d00fd, on top of the
Two suggestions I did not take:
|
Automated AI review
Outcome: At 6bf9de7, the previous review's findings are resolved, except that Enter and toggle keys pressed while fzf opens can still answer Yes.
|
| Earlier finding | Status at 6bf9de7 |
|---|---|
bin/omarchy-confirm not executable |
Resolved: mode 100755, PR test passes |
command -v failed the bin style test |
Resolved: bin-style-test.sh passes (fails at 313900a) |
| Keys typed before the prompt appears | Resolved for y/n/q; Enter and toggle keys remain (above) |
Conflict with quattro |
Resolved: confirm_reboot keeps the unattended guard; phase test passes on a merge with current quattro |
| Optional: h/l/Shift-Tab, Esc comment | Resolved: bound, and the comment matches gum 2.0.2 source |
| Optional: real-fzf block had no timeout | Resolved: a mutant that ignores y/n/q now fails with rc=124 instead of hanging |
Verified (the first review's fixes still hold at this head):
y/n/q,h,l, Right and Shift-Tab after the rows draw- Enter on
--default=falseafter the rows draw answers No - gum fallback when fzf is missing
FZF_DEFAULT_OPTSandFZF_DEFAULT_OPTS_FILEno longer change the answer- mouse clicks on Yes and No return 0 and 1 with
--sync
Mechanism (fzf 0.74.3 source): --sync delays the finder until the input is read, but with no start action bound the key reader starts at once, and the main loop takes whichever of the key and load events is ready first. With a start action bound, fzf holds keys until the start actions have run, and fzf's manual says the list is available to start with --sync (0 misses in 700 runs here). With that change, keys sent as fzf takes the terminal answered correctly in every run (100 per case, 50 for Enter on the default prompt), and the PR's confirm-test.sh and bin-style-test.sh pass with the two greps updated. Keys typed before fzf takes the terminal are safe: Enter does not answer, and y/n/q answer correctly.
Optional note: docs/update-process.md (line 294) still describes omarchy-update-confirm as "Gum confirmation copy" and has no row for omarchy-confirm; updating it keeps the update-flow reference accurate about fzf with the gum fallback.
Review information
Test scope: Source and sandboxed pseudo-terminal runs (fzf 0.74.3, gum 2.0.0) at 6bf9de7 and on current quattro; no live terminal or omarchy update.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
|
@llstrk Thanks for narrowing this to Enter and toggle keys during startup. I reproduced it: at the previous head, early Enter on a No-default prompt answered Yes in 5 of 20 trials, and early Taken in ed6c5f0: the prompt keeps I also updated |
|
Clicking the shell update affordance opens a floating terminal, but gum's confirmation buttons ignore mouse clicks.
omarchy-confirmsupplies an inline fzf yes/no prompt with mouse acceptance, gum-style keyboard controls, custom labels, defaults, and compatible success/cancel exit statuses. The update and reboot prompts use it; a missing fzf falls back to gum.The prompt clears inherited fzf options and combines
--syncwithstart:pos, selecting the default before fzf handles keys arriving during startup. Identical, empty, or multiline choice labels are rejected before prompting. The update-flow reference documents the shared helper.Current
quattrois merged infbf17e1a. Conflict resolution retains upstream's consolidatedomarchy-system rebootcommand and compatibility description foromarchy-update-status, while keeping the mouse prompt. The restart regression now checks that accepting the prompt calls the consolidated reboot command; unattended updates still avoid prompting.Validation: all 80 startup-key trials pass; real-fzf mouse clicks on Yes and No pass under both defaults and hostile inherited options. Prompt/fallback, restart-phase, command-style, Bash syntax, PR diff checks and the full CLI suite pass. A whitespace warning in an unrelated upstream test is excluded from the PR diff check. No live update or reboot was initiated.
Fixes #12348.