Currently using zsh but I installed fish yesterday to try it out because I’m thinking of switching. All the zsh plugins I have are basically just replicating what fish has by default anyway and fish might do it better.
It still gives you basically no advantage compared to just making your terminal emulator launch fish by default. And well, it does give you the major disadvantage that scripts without shebang will fail.
The main differentiator of fish over everything else is it prioritizes intuitive behavior over backwards compatibility.
Zsh is to bash as c++ is to c. Most bash scripts and habits will work in zsh, but zsh is just more convenient and has more options. Fish is intentionally different.
Do I wish fish had existed instead of bash so we had a nicer terminal experience? On the whole, yes. But I also couldn’t be bothered to learn another shell where most of the instructions online won’t be able to help you, and I ended up sticking with zsh.
That isn’t incorrect, but it’s not as important as people make it out to be. Linux isn’t certified as POSIX-conformant either.
People are way too stuck on POSIX regarding Fish specifically, but in shell scripting, POSIX compliance boils down to “can it run a pure sh script”. Bash is compliant. Zsh is partially compliant and needs to set an option to emulate sh. Fish uses a different syntax and is not compliant; if that is a problem, don’t execute sh scripts in Fish.
POSIX compliance for shell scripts was important in the 80s and 90s when the #! directive wasn’t as commonly implemented and every script might be executed by the user’s $SHELL instead. That is no longer the case as virtually every Unix-like system’s program loader supports #!.
It’s a cool shell, I use it as a daily driver (though I’m keeping a close eye on elvish which syntactically is even further away from classic shell), but the comments read like fish is basically zsh. And while zsh is pretty close to bash, fish isn’t.
This is a good way of putting it. It’s essentially ZSH with Autosuggest/complete and a theming agent. At least visual-wise.
When you get into the scripting and the hot keys aspect of it, they reinvent the wheel and everything is different., Like for example ,!! and other bangs(I think that’s the right word?) like that are not valid on fish, And everything to do with variables is different from adding to your path to setting variables to creating functions. Also checking your error code is going to be different as well as it doesn’t follow the $x style inputs and doesn’t support IFS and globbing works differently.
TLDR; fish is nice, but If you use it unless you want to relearn an entire type of language, keep your scripts on bash or zsh
or if you wanna see the bigger differences fish has a dedicated bash transition page
I never managed to learn bash’s ways in my first decade of using it, learning fish a decade ago was easy by comparison. So much more human readable and sensible and consistent. Even though fish is the friendly interactive shell, I now use it for all my scripting too.
# if interactive, launch fish
[[ $- != *i* ]] && return || fish
and
alias f='fish'
So fish is my default, and if I ever need bash, it’s already there underneath, just a Ctrl-d keybind away to fall back on, and if I want to get back into fish, it’s just a f & RETURN away.
Seems better to have all the convenience of fish up front. All the completion magic. I so rarely have to type much at all.
I have that occasionally when I want to copy a complex bash command from somewhere. But yeah, I can then just run bash, run the command in there and then exit back out of there.
But well, I was rather thinking of when it’s using Bash-scripting-syntax to combine multiple commands.
Like, maybe there’s a for-loop in there. You just can’t paste that directly into Fish and have it work. Granted, you should probably put that into a script file, even if you’re using Bash, but yeah, just temporarily launching bash is also an option.
I jumped from bash to fish because cachy os has it as default. I kinda don’t like it, it’s a little too fancy, but it’s not bad enough for me to bother switching the default to bash. So I’m using it. Still not quite liking it but maybe it’s growing on me.
This is bait.
And I’m ready to
fishIt’s time for a
nushellCurrently using
zshbut I installedfishyesterday to try it out because I’m thinking of switching. All thezshplugins I have are basically just replicating whatfishhas by default anyway and fish might do it better.The other way around, fish was implemented with the most popular zsh plugins in mind.
Plus, look at your name!
Just whatever you do, don’t
ln -s /bin/fish /bin/shWell a shell script that can only run with Nash should include !# bin bash in the header.
You assume everyone writes shebangs correctly. Also ideally you’d use
#!/usr/bin/env bashI see.
Proceed to write
#!/bin/env bashIt still gives you basically no advantage compared to just making your terminal emulator launch
fishby default. And well, it does give you the major disadvantage that scripts without shebang will fail.what’s fish got? I’m liking zsh here but am always open to a distraction instead of getting work done. :)
Lovely OOTB defaults. I basically change nothing except the theme.
Autocomplete, git context, etc. The QOL stuff you’d expect.
oh interesting. will give it a shot. basically sounds like zsh plus omz?
The main differentiator of fish over everything else is it prioritizes intuitive behavior over backwards compatibility.
Zsh is to bash as c++ is to c. Most bash scripts and habits will work in zsh, but zsh is just more convenient and has more options. Fish is intentionally different.
Do I wish fish had existed instead of bash so we had a nicer terminal experience? On the whole, yes. But I also couldn’t be bothered to learn another shell where most of the instructions online won’t be able to help you, and I ended up sticking with zsh.
Be aware that fish isn’t a POSIX-compatible shell enough, so you have to adjust syntax.
That isn’t incorrect, but it’s not as important as people make it out to be. Linux isn’t certified as POSIX-conformant either.
People are way too stuck on POSIX regarding Fish specifically, but in shell scripting, POSIX compliance boils down to “can it run a pure
shscript”. Bash is compliant. Zsh is partially compliant and needs to set an option to emulatesh. Fish uses a different syntax and is not compliant; if that is a problem, don’t executeshscripts in Fish.POSIX compliance for shell scripts was important in the 80s and 90s when the
#!directive wasn’t as commonly implemented and every script might be executed by the user’s$SHELLinstead. That is no longer the case as virtually every Unix-like system’s program loader supports#!.I use fish, but sometimes it acts weird. And lots of “just copy and past this command” kind of online solutions I have to put into bash.
My main irk is when I want to forward a ‘*’ to a program but have to escape it.
That’s why it’s a shell for the 90s and not the 80s
It’s a cool shell, I use it as a daily driver (though I’m keeping a close eye on elvish which syntactically is even further away from classic shell), but the comments read like fish is basically zsh. And while zsh is pretty close to bash, fish isn’t.
This is a good way of putting it. It’s essentially ZSH with Autosuggest/complete and a theming agent. At least visual-wise.
When you get into the scripting and the hot keys aspect of it, they reinvent the wheel and everything is different., Like for example ,!! and other bangs(I think that’s the right word?) like that are not valid on fish, And everything to do with variables is different from adding to your path to setting variables to creating functions. Also checking your error code is going to be different as well as it doesn’t follow the $x style inputs and doesn’t support IFS and globbing works differently.
TLDR; fish is nice, but If you use it unless you want to relearn an entire type of language, keep your scripts on bash or zsh
or if you wanna see the bigger differences fish has a dedicated bash transition page
I never managed to learn bash’s ways in my first decade of using it, learning fish a decade ago was easy by comparison. So much more human readable and sensible and consistent. Even though fish is the friendly interactive shell, I now use it for all my scripting too.
thanks for the detail!!
Yup, very similar! And quite customizable as well if you want to. But the focus is on having, by default, a friendly interactive shell.
I like that I can spin up a VM, install fish,
chshand I’m all set.does fish have fuzzy reverse hostory search?
Looks like that is indeed the default option
Fish is great if you can’t remember a specific command, or don’t want to type out long filenames/locations, but I dunno if I’d use it as the default.
I just type “fish” in the terminal if I ever run into a situation where I might get some use from it.
in my ~/.bashrc
# if interactive, launch fish [[ $- != *i* ]] && return || fishand
alias f='fish'So fish is my default, and if I ever need bash, it’s already there underneath, just a Ctrl-d keybind away to fall back on, and if I want to get back into fish, it’s just a
f& RETURN away.Seems better to have all the convenience of fish up front. All the completion magic. I so rarely have to type much at all.
I used to do that, until I realized I never had a usecase for plain bash over fish
I have that occasionally when I want to copy a complex bash command from somewhere. But yeah, I can then just run
bash, run the command in there and thenexitback out of there.that’s what bass is for
I’m guessing, you mean this then: https://github.com/edc/bass
But well, I was rather thinking of when it’s using Bash-scripting-syntax to combine multiple commands.
Like, maybe there’s a for-loop in there. You just can’t paste that directly into Fish and have it work. Granted, you should probably put that into a script file, even if you’re using Bash, but yeah, just temporarily launching
bashis also an option.I jumped from bash to fish because cachy os has it as default. I kinda don’t like it, it’s a little too fancy, but it’s not bad enough for me to bother switching the default to bash. So I’m using it. Still not quite liking it but maybe it’s growing on me.