microsoft / inshellisense

IDE style command line auto complete
MIT License
8.24k stars 181 forks source link

Fail to load zsh binding config: "parse error near `__inshellisense'" #16

Closed chadluo closed 8 months ago

chadluo commented 8 months ago

Describe the bug key-bindings.zsh fail to run when starting a new zsh session.

To Reproduce Steps to reproduce the behavior:

  1. install via npm
  2. bind to zsh by running inshellisense bind and select zsh ~/.inshellisense created
  3. start new terminal session of zsh
  4. error message:

    /Users/chadluo/.inshellisense/key-bindings.zsh:10: parse error near `__inshellisense'

key-bindings.zsh file content:

__inshellisense__() {
    input=$LBUFFER
    LBUFFER=
    inshellisense -c "$input" -s zsh < $TTY
    print -s $(inshellisense --history)
    zle reset-prompt
}

zle     -N   __inshellisense __inshellisense__
bindkey '^A' __inshellisense

Expected behavior inshellisense loaded and working the same as inshellisense --shell zsh I guess?

Environment

Additional context inshellisense --shell works fine

chadluo commented 8 months ago

hmm duplicate #3 & #8