-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Recently, while running the application, there has been a persistent issue where the runner fails to run properly whenever there is a white-space in the path name.
When a file is located in a directory whose path contains spaces (e.g. ~/Documents/ABC COMPANY/), the runner splits the path at the space and passes only the first segment to the interpreter.
This thus results in a "file not found" error even though the file exists.
Note: More generalised issue of #146 , spanning over to other languages as well
Steps to Reproduce
I am taking Python code for this demonstration.
-
Create a file in a directory whose path contains a space:
~/Documents/ABC COMPANY/hello.py -
Open the file in Neovim and run the code runner (e.g.
:RunCode). -
Observe the terminal output:
python: can't open file '/home/user/Documents/ABC': [Errno 2] No such file or directory
Expected Behaviour
The full path should be passed to the interpreter as a single argument:
python3 /home/user/Documents/ABC COMPANY/hello.py
Actual Behaviour
The path is getting split at the whitespace. Only the segment up to the first space is passed:
python3 /home/user/Documents/ABC
The classic faulty white-space parsing
Environment Info
| Field | Value |
|---|---|
| OS | Linux (Arch Linux, tested; likely all distros) |
| Neovim version | 0.10+ |
| Plugin version | latest main |
Although I feel that this bug will show up in other Linux and MacOS environments as well