Search code examples
intellij-ideafish

IntelliJ's embedded terminal does not load fish functions


I'm using IntelliJ's embedded terminal with the fish shell, which works well with one exception: it does not seem to load the fish functions defined in ~/.config/fish/functions/*.

When I use the macOS Terminal.app or iTerm2, the functions get loaded as they are supposed to, only IntelliJ's embedded terminal fails to do so.

Oddly enough, the IntelliJ terminal does load ~/.config/fish/config.fish just fine.

Here's the output of echo $fish_function_path in iterm2 and Terminal.app:

/Users/moritz/.config/fish/functions
/usr/local/Cellar/fish/2.6.0/etc/fish/functions
/usr/local/share/fish/vendor_functions.d
/usr/local/Cellar/fish/2.6.0/share/fish/functions

And here's the output when running the same in IntelliJ's embedded terminal:

/Applications/IntelliJ IDEA.app/Contents/plugins/terminal/fish/functions
/usr/local/Cellar/fish/2.6.0/etc/fish/functions
/usr/local/share/fish/vendor_functions.d
/usr/local/Cellar/fish/2.6.0/share/fish/functions

I guess this looks like IntelliJ's embedded terminal initializes the fish session with a different value for $fish_function_path?

$HOME (=/Users/moritz) and $XDG_CONFIG_HOME (not set) are the same in all three, iTerm2, Terminal.app and IntelliJ's embedded terminal.


Solution

  • I was able to get the same result from echo $fish_function_path in IntelliJ's embeded terminal and iTerm2 by going to Settings | Terminal then turning off Shell integration.

    I was using phpStorm 2017.3.4 but I assume this will also work in any IntelliJ embedded terminal.