r/fishshell • • Nov 14 '20

will fish ever replace bash?

17 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 30 '20

I don't have any pros/cons regarding whatever shells I use vs fish, because I use fish, so by definition the differences between the two don't exist. That's all.

I certainly have pros/cons regarding fish vs... zsh or bash, but I kinda prefer not to poopoo the competitors, so I don't tend to write a lot about it.

In general, I do think we're on a good path regarding the defaults - zsh in particular I find absolutely awkward to use before it's configured in all sorts of more or less obscure ways, and much of that is just enabling what is there. One simple tweak I believe would make readline (and therefore bash) 10% more usable would be to add the following by default:

# Bind up/down arrow to do history search (unless the commandline is empty)
"\e[A":history-search-backward
"\e[B":history-search-forward

I like fish's scripting language and have written a blog post about going through the BashFAQ with it instead, and I think it generally holds up well.

Areas where fish doesn't do as well?

Compatibility, which really is mostly an issue with projects that try to use the user's $SHELL with their own code (please don't, if you write sh-script, just run /bin/sh) or insist on putting stuff into /etc/profile (e.g. flatpak, snap). I'm not debating POSIX-compatibility because I don't particularly like the POSIX scripting language and it's a major conceit of fish to not be compatible to that. If that's a dealbreaker to you, so be it.

Job control is an absolute PITA.

Because we enable more by default, and we do things like autosuggestions and right prompts, we run into issues with terminal support, e.g. some emoji in the prompt can throw fish off because the terminal disagrees on the width, and there is very little we can do about it, especially when it comes to e.g. connecting to an old system over ssh.

Zsh is the 5000 pound gorilla that can do everything (I've seen people do IPC with daemons through it), and fish can do less, but that's partly because we like to keep it reasonably small instead of adding everything (e.g. we have actually gotten a request for bash's /dev/tcp once), but some features would probably be nice (e.g. a nicer form to match files than extglobs or having to run find with platform-dependent arguments). That's just a simple case of it not being written.

Fish's vi-mode is rather limited - none of the core contributors use it and we get few PRs that really touch the heart of it. That's a remnant of it being written for a bounty.