microsoft / inshellisense

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

`inshellisense bind` generates windows line endings on linux #23

Closed pvares closed 8 months ago

pvares commented 8 months ago

Describe the bug

When installing bindings for zsh (other shells haven't been tested) the file ~/.inshellisense/key-bindings.zsh is generated with windows line endings (\r\n) causing parse errors when loading: /home/<username>/.inshellisense/key-bindings.zsh:10: parse error near '__inshellisense'

Workaround Run dos2unix ~/.inshellisense/key-bindings.zsh

To Reproduce Steps to reproduce the behavior:

  1. Install inshellisense on Linux
  2. Run inshellisense bind and select zsh
  3. Relaunch/reload shell (source ~/.zshrc)
  4. note parse error

Expected behavior Inshellisense should generate line endings appropriate to the OS

Environment

Additional context Running oh my zsh, but problem appears to continue with bare zsh as well. Original key-bindings.zsh file and updated dos2unix key-bindings.zsh files are attached (file extension changed to .txt to allow upload)

dos2-unix-key-bindings.zsh.txt original-key-bindings.zsh.txt

jimkutter commented 8 months ago

Confirmed. Having the same issue on bash.

My Steps:

cpendery commented 8 months ago

Thanks for reporting this! It looks like the same issue as #16, #8, & #3. I have a fix in the build pipelines for the next pre-release, so that should fix it for you.