Repository navigation
fix(zsh): keep deferred line-init defined for plugins that wrap it by name - #26157
petersindex wants to merge 1 commit into
Conversation
… name zimfw/input chains zle-line-init by splicing the bound function's name into its own body. In an Orca pane that name is __orca_deferred_line_init, and the deferred init deleted it once no widget pointed at it, so every prompt printed "command not found: __orca_deferred_line_init". Leave the function defined. Its guard returns immediately once __orca_deferred_init is gone, so keeping it changes nothing else. Fixes stablyai#26029
fd64fe8 to
76fd16a
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Zsh deferred cleanup no longer scans widget bindings or removes Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change addresses the repeated zsh prompt error without an identified merge-blocking risk. Normal validation remains appropriate before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Records the retained adapted contribution from #26157 in replacement PR #26842. Co-authored-by: petersindex <[email protected]>
|
closing this one. #26842 fixed the same zsh line-init issue, so mine's not needed. |
Fixes #26029
ELI5
When Orca starts a zsh terminal, it installs a small temporary startup helper and deletes it once startup finishes. Some zsh plugins (like zimfw/input) copy a call to that helper into their own code. Orca's "is anything still using this?" check couldn't see that, so it deleted the helper anyway, and every prompt printed
command not found: __orca_deferred_line_init. Now Orca keeps the helper. After startup it returns immediately, so keeping it is harmless.What changed
unfunction __orca_deferred_line_initfrom the deferred-init cleanup block insrc/main/zsh-deferred-startup-line-init.tsO_IRassertion, which checked that the helper had been deleted (the behaviour this PR removes on purpose)Why this over the alternative
I considered keeping the cleanup and also scanning
${functions[@]}bodies for the name. That still misses calls held inevalstrings or variables, would have to exclude Orca's own functions (which contain the name), and adds work to the first prompt on frameworks with hundreds of functions. The scan has already been patched once (for theadd-zle-hook-widgetalias), and zimfw is a second miss. Leaving one inert function defined closes the whole class of bug.Testing
bdec2b3: the error prints at every prompt._start_application_modestill contains the__orca_deferred_line_initcall andzle-line-initis bound to it, so the plugin really was active.mainwith the exact error from the issue and passes with the fix. The zsh live-shell suites and wrapper snapshot test pass (70/70).pnpm typecheckandpnpm lintpass.pnpm testlocally: 279 unrelated files fail becausenode:sqliteis unavailable in my local runtime (Node 25; the repo pins 24) and Electron APIs are missing under the Bun runner. I reran exactly those files on unmodifiedmainand the identical 279 fail, with none unique to this branch.Screenshots
Before (Orca Dev on

main):After (Orca Dev on this branch):

AI review
X: @petersindex