Search code examples
fish

Fish Shell hangs on startup


I'm on a Mac, Yosemite. I installed Fish yesterday and it was working fine, but today when opening a new window it just hangs.

My ./config/fish/fish.config is currently empty so I don't believe its a config issue.

After restarting, running with debug produced the following:

fish: Could not connect to socket -1, starting fishd

Grepping showed that fishd was not running, so I started fishd manually, then ran fish with debugging and got the following:

fish: Connect to socket /tmp/fish.kscott/fishd.socket at fd 3 fish: Connected to fd 3 fish: Create barrier fish: before write of 8 chars to fd 3 fish: Wrote message 'BARRIER ' fish: Sent barrier request

And fish continues to hang for me, so I'm currently back in bash.

I'm not really sure how to debug further; is there something I'm missing with the setup process?

-- EDIT --

In response to ridiculous_fish below, my config.fish was initially:

alias gg 'git grep'

set -x ACKRC '.ackrc'

set -U fish_user_paths $fish_user_paths /opt/local/bin /usr/local/bin /npm/bin /Users/kscott/fish_scripts

And the output of a line from ~/.config/fish/fishd.* is huge:

SET fish_user_paths:/usr/local/bin\x1e/Users/kscott/bin\x1e/opt/local/bin\x1e/usr/local/bin\x1e/.... goes on and on for 30 lines`

Can I delete this file safely, or clear it out?


Solution

  • Universal variables are automatically persisted between sessions. So when you write this:

    set -U fish_user_paths $fish_user_paths /opt/local/bin...
    

    That the $fish_user_paths variable longer every time you start fish. Eventually it will become so big that it hangs.

    To fix it, you can either ensure fishd is not running and then edit the file by hand to remove that line, or you can (from fish) just run set -U fish_user_paths /opt/local/bin /usr/local/bin /npm/bin /Users/kscott/fish_scripts to set it once.

    set -U commands are pretty much always a mistake in config.fish. We'll likely add a warning for this case - see #2005.