You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
config.buffer_editor "The system cannot find the file specified." #8714
How do I get nushell to use sublime text 3 for editing files with a space in the path?
It stops parsing on the first space and tries executing c:/program
Additional context and details
~> config nu 04/02/2023 06:37:50 pm
Error: nu::shell::external_command
× External command failed
╭─[entry #1:1:1]
1 │ config nu
· ────┬────
· ╰── executable 'c:/program' was not found
╰────
help: The system cannot find the file specified. (os error 2)
~> $env.config.buffer_editor 04/02/2023 06:37:53 pm
C:/Program Files/Sublime Text 3/subl.exe
How does your config.buffer_editor config line look like?
Since #8105 we support the addition of flags in the EDITOR/VISUAL environment variable which includes splitting by space. Apparently the same is true for $config.buffer_editor
Error:
× Invalid literal
╭─[C:\Users\owner\AppData\Roaming\nushell\config.nu:282:1]
282 │ float_precision: 2 # the precision for displaying floats in tables
283 │ buffer_editor: "C:/Program\ Files/Sublime\ Text\ 3/subl.exe" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
· ────────────────┬────────────────
· ╰── unrecognized escape after '\' in string
╰────
Backticks with escaped spaces gives different error
~> config nu 04/02/2023 08:20:20 pm
Error: nu::shell::external_command
× External command failed
╭─[entry #1:1:1]
1 │ config nu
· ────┬────
· ╰── can't run executable
╰────
help: program path has no file name
Activity
sholderbach commentedon Apr 2, 2023
How does your
config.buffer_editorconfig line look like?Since #8105 we support the addition of flags in the
EDITOR/VISUALenvironment variable which includes splitting by space. Apparently the same is true for$config.buffer_editorJABirchall commentedon Apr 2, 2023
buffer_editor: 'C:/Program Files/Sublime Text 3/subl.exe'
The rest of the config is default.
fdncred commentedon Apr 2, 2023
I thought you had to use backtick quotes for spaces in folder name like this:
Does that work for you?
JABirchall commentedon Apr 2, 2023
That still results in the same error. I've tried double quotes, single quotes, backtick and backtick inside double quotes.
The only one which gives different error, is backticks inside double quotes
gives
sholderbach commentedon Apr 2, 2023
Yeah I think we need to rethink the solution to #8051 from #8105
JABirchall commentedon Apr 2, 2023
Also traditional methods dont work such as escaping the space
this just results in a config error
Backticks with escaped spaces gives different error
fdncred commentedon Apr 2, 2023
@JABirchall, I agree with @sholderbach, that our accepted solution probably needs a rethink.
However, even though this is a total hack, it may get you going. You could try to use Windows' short filenames like
'c:\progra~1\blah. You just need to do adir /xfromcmd.exeto see what they are for your path https://manjusullad.wordpress.com/2016/01/06/how-can-i-find-create-short-path-for-windows-folders-directories/JABirchall commentedon Apr 2, 2023
Thanks, I didnt know windows did this.
This works
Fix editor config for reedline and `config nu/env` (#10535)
Fix editor config for reedline and `config nu/env` (nushell#10535)