Repository navigation
Conversation
The select and input menus wrote the pick with bash -c "printf ... > file", which put the chosen row, or the text typed into an input prompt, on a command line that every user on the machine can read in /proc/<pid>/cmdline. Write it, and the done file, with a blocking FileView instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
omarchy-menu-select put every row into the select payload, a single argument to perl and omarchy-shell. Linux refuses a single argument of 128 KiB or more, so a long list never opened the menu, and every user on the machine could read the rows in /proc/<pid>/cmdline. Write them to a mktemp file instead, name it as optionsFile in the payload, and read it in the menu with a fresh blocking FileView. Inline options keep working, and a file the shell cannot read cancels the request. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The rows' height binding follows the model's count and measures every row, so appending a select list row by row was quadratic: 1,000 rows took 263 ms to open, 4,000 took 3.9 s, past omarchy-shell's 2 s IPC timeout, and omarchy-menu-select gave up although the menu then opened. Build the rows first and append them at once; 4,000 rows now open in about 50 ms. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A caller that gives up before the menu finishes, because its summon timed out or it was stopped, removes its selection file on the way out. The shell then wrote the pick anyway, creating a new file at that path with the default 0644 mode, so the pick stayed in /tmp, readable by every user, until reboot. The bash -c printf it replaced did the same. Write neither file once the selection file is gone; a waiting caller's mktemp file is empty, and an empty file still loads. A request whose rows cannot be read is answered the same way. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
openDmenu and openExistingMenu took over the menu's request without answering the one they replaced. omarchy-menu-select and omarchy-menu-input wait for the done file with no timeout, so a picker replaced by another picker or by a menu summon never returned, and its caller polled every 50 ms until it was killed. Answer it as canceled first, the way the image picker answers a request it replaces. The same request delivered again is left alone, and a request whose rows cannot be read still leaves the waiting one alone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge. SummaryThe menu now cancels a waiting picker before another picker or menu replaces it.
No actionable issues found. Tests were inspected but not run during this review.
|
|
Reviewed this pull request's own commit, 38c9f0d, on top of #15774's four commits. Nothing found to change. The bug is real, and this fixes it. On a worker built from the Omarchy ISO, running each tree as the live shell, I started a picker, summoned something else over it through IPC, and checked whether the first caller returned within 3 s:
The change is the size of the problem: two guarded Tests, on the worker: Second opinion: Codex Medium reviewed the commit and found no defects. It agreed the hang is real and the fix proportionate, and on its own checked that the new test fails with either call removed. It can read this session's work, so its agreement is not guaranteed to be independent. #15518 and #15519 touch Labelled |
|
Closing as a duplicate. #7826 made this change first, back in August, and omarchybot verified it; #9056 does the same. I missed both before opening this one. Sorry for the noise. One thing I learned here that matters for #7826: with #15774's in-process writes, #7826's
|
Builds on #15774. Its four commits come first here, and this PR's own change is the last commit, 38c9f0d. I'll rebase onto
quattroonce #15774 lands.When a summon opens the menu while a picker is still waiting for its answer,
openDmenuandopenExistingMenutake over the request without answering the one they replace.omarchy-menu-selectandomarchy-menu-inputwait for the done file with no timeout, so the replaced caller never returns. It polls every 50 ms until something kills it, and whatever script called it is stuck too. It takes a second picker, or anomarchy menu summon, while the first is still waiting. Codex's second opinion in omarchybot's review of #15774 found it.Both functions now answer the waiting picker as canceled first, so its caller exits 1 with no output, the way the image picker's
openSelectoralready answers a request it replaces. A request delivered again with the same done file is left alone, and a picker whose rows can't be read is refused without touching the one waiting.docs/menu.mdnow says a replaced picker exits 1.Validation (Omarchy 4.0.4-1, Quickshell 0.3.1)
test/shell.d/menu-replaced-request-test.shruns the shippedopenDmenu,openExistingMenu,finishRequestandanswerRequestundernode:vm, with the display stubbed and the request files recorded:menu-open-budget-test.shdoes, and opened a second request over a waiting first one through IPC:./test/clipasses, and so domenu-test.sh,menu-transport-test.sh,menu-replaced-request-test.sh,menu-open-budget-test.shandapp-search-test.sh../test/shellfails the same 19 files here as on Open long select menus and keep their rows and picks off command lines #15774 and untouchedquattro. It also failedlock-appear-budget-test.shonce: the lock view took 782 ms against a 750 ms budget. That test then passed three runs on its own, and omarchybot's worker fails it onquattrotoo.git diff --checkandbash -npass.🤖 Generated with Claude Code