microsoft / inshellisense

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

bash `syntax error near unexpected token` #15

Closed flex1988 closed 8 months ago

flex1988 commented 8 months ago

Describe the bug after inshellisense bind,run bash and get error syntax error near unexpected token

image

David-Alfred commented 8 months ago

facing the same issue

OS: Arch Linux on Windows 10 x86_64 Kernel: 5.15.90.1-microsoft-standard-WSL2

pstachula-dev commented 8 months ago

Same problem on zsh

abusaidm commented 8 months ago

Managed to solve the issue by changing the Line Sequence in the file to LF.

Steps:

  1. Open editor of choice, I used VSCode
  2. Load the target file in VSCode ~/.inshellisense/key-bindings.bash
  3. Command pallet Change End of Line Sequence
  4. Save file
  5. reload terminal or reload file on active terminal using source

image

potyl commented 8 months ago

@abusaidm thanks for the solution.

We can use the CLI to fix it too:

dos2unix ~/.inshellisense/key-bindings.bash
cpendery commented 8 months ago

I've updated the private build pipelines such that all the file extensions will be LF instead of CRLF. Closing and this will be included in the next pre-release.