← Back to context

Comment by CjHuber

1 day ago

I'm so glad I switched to fish, I'd rather have genuinely good settings out of the box rather than endless configuration, and honestly it's much better out of the box than any configuration I've ever had.

Only drawback is that it's not POSIX, no issue for me, but maybe for people who have a lot of muscle memory with bash.

I tried fish for a while but as someone who heavily used bash before I couldn't get used to the new language. I also didn't feel they the language was much better than bash, at least for my usage. But I loved the default automatic coloring of arguments, underlining of files, etc.

Later I found fizsh, which I love and still use as default shell now. It's basically a configuration around zsh adding the colors, completions, and other good stuff inspired by fish to zsh. Can really recommend it for those who are used to zsh or bash but want their CLI to be more readable. Colors especially help with big command line arguments to show where they start and end, and keeping track of complex stuff like loops and conditional logic in your commands.

For POSIX: I leave Bash as the system shell and then shim into Fish only for interactive terminals. This works surprisingly well, and any POSIX env initialisation will be inherited. I very rarely need to do something complicated enough in the REPL of the terminal and can start a subshell if needed.

Fish is nicer to script in by far, and you can keep those isolated with shebang lines and still run Bash scripts (with a proper shebang line). The only thing that’s tricky is `source` and equivalents, but I don’t think I’ve ever needed this in my main shell and not a throw-away sub shell.

  • I often write multi-line commands in my zsh shell, like while-loops. The nice thing is that I can readily put them in a script if needed.

    I guess that somewhat breaks with fish: either you use bash -c '...' from the start, or you adopt the fish syntax, which means you need to convert again when you switch to a (bash) script.

    • I guess my workflow for this is more fragmented. Either I’m prototyping a script (and edit and test it directly) or just need throwaway loop (in which case fish is nicer).

      I also don’t trust myself to not screw up anything more complex than running a command on Bash, without the guard rails of something like shellcheck!

      1 reply →

Fish is just excellent out of the box. It's a little tragic how path dependent we are on flawed terminal experiences designed 40 years ago.

After 10 years on zsh I finally switched 6 months ago and I haven't looked back. If I need POSIX, I'll just run scripts with the right shebang or pipe it to sh.

I've been using fish for nearly 10 years.

First, there are some ways to make fish more compatible with bash.

If you want to do some shell scripting in fish, or running other people's shell scripts (or commands) this may aid you since you wouldn't have to port them (or take less time to port them over).

You can achieve this with a plugin system such as 'oh my fish' or 'fisher'. But, as always, it adds complexity (and bloat :P), you'll need it on every fish shell (including remote systems), etc.

It is a bit akin to having nvim with plugins versus being able to use vi. Sometimes, you're going to need to be able to use the latter.

Also, to people who recently adopted fish: fish has been made more and more compatible with bash throughout those years.

FWIW, I use fish with starship these days.

It’s only takes a second to run a child bash shell when you need something posix

I have been using fish for 10 years now as my main shell and it is just perfect.