Fix zsh Tab acceptance in shell-ready wrappers#1125
Fix zsh Tab acceptance in shell-ready wrappers#1125heyramzi wants to merge 3 commits intostablyai:mainfrom
Conversation
|
@nwparker can help review. |
|
Thanks for digging into this. After checking Tabby, WaveTerm, and VS Code, I don’t think they solve this at the terminal-emulator/xterm layer. They generally pass Tab through to the shell unless their own focus/keybinding policy consumes it. This is something users can resolve in their zsh config today. For # ~/.zshrc, after zsh-autosuggestions is loaded
bindkey '^I' autosuggest-acceptA safer version that preserves normal Tab completion when no inline suggestion is visible is: # ~/.zshrc, after zsh-autosuggestions is loaded
_orca_tab_accept_suggestion_or_complete() {
if [[ -n "$POSTDISPLAY" ]] && (( $+widgets[autosuggest-accept] )); then
zle autosuggest-accept
else
zle expand-or-complete
fi
}
zle -N _orca_tab_accept_suggestion_or_complete
bindkey '^I' _orca_tab_accept_suggestion_or_completeThat should work in Orca as well as Tabby/WaveTerm, because Tab reaches zsh as Given that, I’m leaning against taking a broad Orca default here, especially if it binds |
|
Closing for now, but happy to re-open the dicussion! |
This updates Orca's generated zsh shell-ready wrapper so Tab binds to forward-char, matching the same accept path as the right arrow for shells using zsh-autosuggestions.\n\nChanges:\n- add a shared zsh shell-ready rcfile helper\n- use it in both daemon and local PTY shell-ready wrappers\n- export the helper through the PTY IPC layer for tests\n- add a regression test for the generated zsh rc content\n\nVerification:\n- pnpm -C /Users/ramzi/Studio/orca typecheck:node\n- pnpm -C /Users/ramzi/Studio/orca test -- src/main/ipc/pty.test.ts (pulled in unrelated suites and hit pre-existing Electron/environment failures before the targeted test could be isolated)