Sublime Forum

Sublime does not seem to respect Fish Shell configuration

#1

Hey there, I’m having some trouble with Sublime & the Fish Shell.

As I understand it, within Fish, all files under the config directory’s “conf.d” directory should be run at shell startup.

However, when using anything under that directory (in my case to modify environment variables, dynamically appending to PATH), Sublime does not seem to actually respect those files having run at all.

My guess is that there is some fish-specific startup logic that might be incorrect, as Fish normally uses spaces to delineate within PATH, but the output of os.environ['PATH'] shows colons. So that means that it’s being converted at some stage, but not after a full startup, as os.environ does not list any other universal (or other level) environment variables set within my conf.d directory’s files.

Any help would be appreciated! Thanks!

0 Likes

#2

The OS and ST console output would help, in any case Sublime Text generally won’t get enrionment variables that are only for an interactive shell.

0 Likes

#3

That is unfortunate. I use a Fish-native NVM setup for Node, and would prefer not to modify my PATH variable (could be messy with multiple node entries) or have a separate non-NVM install solely for Sublime to recognize it.

I realize now that I did not mention I am on MacOS right now for this scenario.

That being said, I’m unsure what Sublime logs (I’m assuming SL is Sublime?) that would be helpful here. What did you have in mind? Similar question for OS logs, not sure what would be more helpful than the description given.

0 Likes

#4

To get environment variables on macOS ST spawn a non-interactive shell and queries the environment. This will fail if the shell takes too long to respond, an error gets logged in this case.

0 Likes

#5

Looks like launching it from the CLI populated something, and now the LSP package can find my Node installation, and now I don’t even need to launch it from the CLI for that to work. Unsure why that’s the case, but it’s some kind of good news.

But thanks for clarifying that Sublime spawns with a non-interactive shell for macOS, that makes more sense of the initial situation now.

0 Likes