question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FVim startup script has trouble with environment variable values with spaces

See original GitHub issue

I was not able to start FVim at all, it claimed nvim was not in the path. I think I tracked this down to the fvim-osx-launcher file in /Applications/FVim.app/Contents/MacOS

The bash snippet in there can’t deal with spaces in environment variable values, in particular if you have VScode installed, you probably got /Applications/Visual Studio Code.app/Contents/Resources/app/bin added to your $PATH. But when the launcher script is run your $PATH will get truncated after /Applications/Visual. If nvim is in a directory after that, FVim will not find it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
crocommented, Oct 22, 2021

Bash was doing string splitting in the for statement based on the default IFS (Internal Field Separator) value, which is usually space, tab, and newline. Resetting it to just a newline helps. This is non-obvious behavior, but has been around in Bash and other Unix-derived shells for a long time. I always have to look it up 😁 .

0reactions
yatlicommented, Oct 23, 2021

Wow. Thank you for explaining! This is truly non obvious that I read twice and didn’t realize!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spaces in the shell variables breaks command calling #5136
Vim/Gvim cannot use a shell command if the shell variable includes a space. Different escaping methods methods do not resolve the problem.
Read more >
Setting environment vars containing space with env
This works: env -S "`cat .vars`" command. First, in your file, you'll need to quote the variable value. VALUE="This has spaces".
Read more >
batch file - How to set environment variables with spaces?
The error output by command setx is caused by wrong usage of the quotes on assigning the string to variable value .
Read more >
How do I add environment variables?
To set an environment variable from a script, use the export command in the script, and then source the script. If you execute...
Read more >
What are PATH and other environment variables, and how ...
Environment variables hold values related to the current environment, like the Operating System or user sessions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found