Repository navigation
fix(zsh): keep deferred line-init defined for plugins that call it by name - #26842
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
📥 Commits
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Plugins can call the deferred line-init helper by its copied name after startup without encountering a missing-command error; the helper is then inert. No actionable merge risk is established. Pre-merge checks |
|
Records the retained adapted contribution from #26157 in replacement PR #26842. Co-authored-by: petersindex <[email protected]>
1bb3bee to
9235c20
Compare
… name Fixes #26029 Co-Authored-By: petersindex <[email protected]>
b4e3945 to
267ffa1
Compare
ELI5
Some zsh plugins made every new prompt in an Orca terminal print
command not found: __orca_deferred_line_init. Prompts now stay clean and the plugin keeps working.What Changed
Before: with a plugin such as an input-mode plugin loaded, each prompt printed the error above. After: no error, and the plugin's own code still runs on every prompt.
Orca's zsh startup script installs a small one-time function,
__orca_deferred_line_init, and deleted it once startup finished, after checking that no key-binding widget still pointed at it. Some plugins don't point a widget at it; they copy a call to it into the body of their own function. That check can't see such a call, so the function was deleted while the plugin still called it. Now the function stays defined. Its first line already returns right away once startup is done, so a leftover call does nothing. The same generated script is used for local terminals, the terminal daemon, and remote (SSH) hosts, so the fix reaches all three.Why
Keeping one inert function is the only way to cover every place a plugin might keep a reference. Scanning plugin function bodies for the name would still miss calls kept in variables or built at runtime. This adapts @petersindex's original fix in #26157.
Linked Issue
Fixes #26029
Visual Proof
N/A: this changes shell startup text only; no Orca layout or interaction changed. The new real-zsh test prints the exact error on main and is clean with this change.
Testing
A new real-zsh terminal test runs a plugin that copies the call into its own function, for the local and daemon scripts (the remote-host script is generated by the same builder, and its snapshot shows the same eight-line removal). On main both fail with
command not found: __orca_deferred_line_init; with this change they pass, the plugin runs on every prompt, and a direct call after startup returns 0 and does nothing. The test is added to the existing deferred-startup test file, which already runs in the shell test lane. The generated-script snapshots lose exactly the eight deleted cleanup lines per script. Focused zsh suites (72 tests), node typecheck,pnpm lint, and the changed-code quality gate pass on macOS zsh 5.9.AI Disclosure
Review
Self-reviewed and independently reviewed for P0/P1 issues (re-sourcing the script, the widget chain, exit status, local/daemon/remote parity). No findings.
Agent skill upstream boundary
Notes
The function lives only inside each shell and is not exported. Native Windows shells don't use this script; WSL zsh uses the same local script. No RPC, wire, or launch-argument changes, so mixed client/host versions are unaffected. Folder workspaces and all git providers use the same shell startup path.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)