Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

You don't need to rewrite any script as long as your scripts have the correct shebang, those scripts works perfectly.

I would strongly not advise to make it the default shell though as this can lead to issues. The way I use it is to have bash as my main shell but my .bashrc starting fish if it's not started explicitly from bash: (it's a trick form arch wiki)

if [[ $(ps --no-header --pid=$PPID --format=cmd) != "fish" ]] then exec fish fi

I've been using fish for a long time with this setup and never encountered an issue.



> I would strongly not advise to make it the default shell though as this can lead to issues.

I've heard this a lot, but I've been using Fish as my login shell for many years, and it's really not a problem

I think maybe some vim plugins call out to your $SHELL or something, but assume that it's bash-like? but I've never run into a serious issue with just using Fish as my login shell


I don't remember the root cause as it was a while ago now, but in my case I couldn't login on a TTY because of that.


That would be a nightmare for sure. I can't blame you for being cautioned by an experience like that.

I've been running Fish as my login shell for almost 10 years now, on Linux and then additionally for ~4 years for intermittent macOS usage (only at work) without issue.

I don't really like launching Fish from ~/.bash_profile because or similar because I don't like having to type `exit` twice to exit, and `exec`ing into Fish leaves you in one shell but with your $SHELL variable set to another.

But if that works for you, more power to ya, and it's good for Fish users to know that that's an option if they run into issues using Fish as a login shell.


Now that you say that, that's funny as I do not have to exit twice. I don't know why though as it seems that it should be the case.


Does your profile call `exec fish -i` rather than just `fish -i`? In that case, you'll only exit once :)

From the `exec` manual:

       If exec is specified with command, it shall replace the shell
       with command without creating a new process. If arguments are
       specified, they shall be arguments to command.  Redirection
       affects the current shell execution environment.

https://man7.org/linux/man-pages/man1/exec.1p.html


I do `exec fish` indeed, so that's the reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: