I was in a similar situation 2 years ago and I took the plunge. Turns out, the amount I had to rewrite was fairly minimal, and the benefits of Fish are just incredible. I'd say: go for it, you won't regret it!
zsh tends to actually run scripts when you feed them. As long as you can resist the urge to run all of your POSIX scripts in fish, I think I much prefer fish as an interactive shell.
I used fish for a long time, but lost patience with the incompatibility with other shells. It’s nice to be able to just paste and run someone else’s command, and I eventually tired of having to rewrite every command to use fish syntax. For example, replacing FOO= with set - x …
The reverse is even worse—if I need to send someone a command to run, I have to rewrite it in a syntax that’s likely to work when they run it. It only takes a few seconds each time but I grew weary of it.
Personally, I'm a lover of subshells, I often write things like (cd mydir && make), making use of the fact the 'cd mydir' only happens in the subshell.
Fish doesn't have anything like that, there are a few workaround, but none of them are (in my opinion) anywhere near as nice.
Last time I looked into switching the vim mode in zsh was better by enough of a margin that I didn't switch, but that was years ago. I've been meaning to give fish another shot.
zsh has survived for longer (it's "Lindy") and is therefore more widely available on remote machines. Also, maybe just my problem, but I do get frustrated having to switch back to bash/zsh syntax and semantics in cases where Fish isn't available, or when writing scripts others will use. Easier for me to stick with zsh for my shell and bash for shipping shell scripts.
You can 1. Make your scripts executable or 2. Use bash / zsh inside of fish. 3. You can define wrapper functions in fish that just call bash/zsh functions internally.
I use fish, although I hate writing scripts in it. It just feels wrong. Better stick to good old bash.
One of my favorite things about fish is that it bundles completions for a huge number of packages. My experience with bash was that completion support was very spotty
Zsh completions can be hit or miss. Sometimes they make huge differences to how path argument selection works (tab completion) in confusing ways that are inconsistent between commands.
Great! Love the new Astronaut prompt. I dabbled with starship.rs, and really liked the prompt, but ultimately didn't want to deal with an extra moving part in my terminal setup. I'm so happy that some of it is available in stock fish shell, now.
What would you prefer? You can always manually edit config files, or you can have a UI that lets you preview how various things will look and simplify changes. Seems like the best of both worlds.
Could be useful the first time, but after that just clobbers things? Ten themes are not enough for any but the most casual users. These cases don’t fit the terminal well.
If it were a curses app with complete (or non-clobberful) customization I might see the point.
I really love fish and used it daily for many years. Then I started work at a new company that had an existing library of internal shell tools that weren't compatible with Fish and the effort to port them was too much.
I found that ZSH managed with OhMyZSH plugins gets me similar functionality without the syntax incompatibilities. Unfortunately unless Fish moves back towards compatibility I don't see myself ever going back, it's just too much hassle dealing with little syntax issues all the time.
I’m an avid bash user for the same fear of incompatibility. But how does that work in practice? I mean- if I use Fish shell interactiveley, how does that affect shell scripts? I presume they would still be run via bash (#!/bin/bash)
Executing programs (including scripts, which are indicated by shebangs like #! /bin/bash) is the operating system's responsibility, not the shell's.
So yeah, shell scripts work exactly the same if you're running them as an executable. Some scripts, however, (like for instance .bashrc) are intended to be sourced by the shell rather than invoked as an independent executable. These won't work, and will need to be ported.
I'm running fish for at least 8 years now and I'm very happy with the out of the box experience. It's one of the first things I install on new machines.
> ampersand-nobg-in-token, which means that & will not create a background job if it occurs in the middle of a word. For example, echo foo&bar will print “foo&bar” instead of running echo foo in the background and then starting bar as a second job.
Yes! This has been annoying with curl for a long time.
Since such URLs very often come from copy & paste another way to deal with this is smart auto-quoting when a paste is detected via the "bracketed paste" feature of modern terminal emulators. zsh does this if you enable url-quote-magic.
For me, fish made my life instantly better without any real investment coming from bash. There are some incompatibilities, but I felt productive right away.
I always recommend fish to anyone who doesn't (yet!) have strong opinions about their shell.
Immediately seeing if you misspelled a command because the color changes is a huge benefit if you're not super familiar with the command line.
The auto-complete and suggestions are also miles better than bash - they are automatically generated from man pages, so most commands have a usable set of completions.
The web-based config lets you easily tweak settings that would otherwise be an incomprehensible soup of PS1=3!@*(!@!@ gobbledygook.
Also, it mostly "just works" out of the box, so you really don't have to waste any time setting anything up if you don't really care.
> The auto-complete and suggestions are also miles better than bash - they are automatically generated from man pages, so most commands have a usable set of completions.
I never understood this. It's always seemed worse - in bash/zsh I can tab complete branches/tags etc in git, pods/deployments etc in kubectl. I try that in fish and it'll just list files in my PWD
I used zsh for years with a moderately elaborate configuration that grew into a pain in the ass to manage. I started using fish a few months ago with no configuration of my own. I'm still not sure if I'll stick with it in the long run, but if nothing else it's a welcome reprieve.
The auto-completion alone is worth it IMO. I've been using fish for 6 or 7 years now, and having it hint ahead some obscure command that I only use once a month saves me so much time reading MAN/searching online.
Pair that with tldr and it's a really good experience.
Yes, it's worth it! Fish is especially great for users who have found learning bash troublesome or uninviting. It's simpler and easier to learn, and plus it has very pleasant defaults and builtins. If you get started with Fish, you're much more likely to learn advanced functionality because the journey is more enjoyable than with bash.
This killed all shell interaction within my tmux setup, somehow, and I had to downgrade in osx/brew [1] back to v3.4.1 [2]. I'm still wondering what part of my (probably outdated) tmux config caused it, but the most suspicious part is the run-shell/if-shell stuff.
Anyway, have things to do before I can try again and dig in. Thought I'd post in case someone else ran into this.
[Edit] Tip: swap to a different shell before uninstalling your current shell. Sigh...lol
Hello, fish shell dev here. We opened an issue on our tracker - when you get a chance we'd appreciate if you'd share some tmux logs there, as I wasn't able to reproduce with your config file.
Fish is fantastic. Some people worry about posix compatibility and stuff, but that only matters if you are copy pasting bash snippets directly to the command line. If you are using bash or zsh as a programming language then you put the code in a file, and run it with that shell - so it doesn't matter what shell you are running.
If you love bash or zsh, and are in the habit of building long complex commands on the command line, then stick with bash or zsh. But if you are just running commands fish is far superior. If you are not a bash/zsh/posix expert fish is a cleaner language and you'll learn it more easily. A fully tricked out zsh might do everything that fish does, but it is very slow compared to fish.
> If you love bash or zsh, and are in the habit of building long complex commands on the command line, then stick with bash or zsh.
Fish handles this very ably as well, of course! If you're a developer and you work in or deploy to a lot of environments where you can't install software, choosing what comes with the environment makes sense. But even when it comes to scripting, you won't regret sticking with Fish, imo.
73 comments
[ 5.3 ms ] story [ 156 ms ] threadIs there any reason to use Zsh at this point over Fish?
fish: Invalid redirection target: yq3 r <(kubectl get nodes -o yaml)
Also, you could do what I do: leave bash or something else as the default, and then just run fish manually.
Then if I have a problem pasting or something I run type exit.
But the incompatibilities are a lot less now.
Fish doesn't have anything like that, there are a few workaround, but none of them are (in my opinion) anywhere near as nice.
> archlinux-java (#8911)
> apk (#8951)
> brightnessctl (#8758)
> efibootmgr (#9010)
> fastboot (#8904)
> optimus-manager (#8913)
> rclone (#8819)
> sops (#8821)
> tuned-adm (#8760)
> wg-quick (#8687)
One of my favorite things about fish is that it bundles completions for a huge number of packages. My experience with bash was that completion support was very spotty
https://github.com/zsh-users/zsh-completions
Have you tried it?
If it were a curses app with complete (or non-clobberful) customization I might see the point.
If you only need it once, just don’t launch it again? It’s not like it’s always running.
I found that ZSH managed with OhMyZSH plugins gets me similar functionality without the syntax incompatibilities. Unfortunately unless Fish moves back towards compatibility I don't see myself ever going back, it's just too much hassle dealing with little syntax issues all the time.
So yeah, shell scripts work exactly the same if you're running them as an executable. Some scripts, however, (like for instance .bashrc) are intended to be sourced by the shell rather than invoked as an independent executable. These won't work, and will need to be ported.
Yes! This has been annoying with curl for a long time.
(I'm a fish developer)
3 months ago, 90 comments https://news.ycombinator.com/item?id=30734072
3 months ago, 20 comments https://news.ycombinator.com/item?id=30660587
7 months ago, 291 comments https://news.ycombinator.com/item?id=29341390
I respect the craftmanship, but if I'm more of a "software carpenter" why should I invest the time?
Immediately seeing if you misspelled a command because the color changes is a huge benefit if you're not super familiar with the command line.
The auto-complete and suggestions are also miles better than bash - they are automatically generated from man pages, so most commands have a usable set of completions.
The web-based config lets you easily tweak settings that would otherwise be an incomprehensible soup of PS1=3!@*(!@!@ gobbledygook.
Also, it mostly "just works" out of the box, so you really don't have to waste any time setting anything up if you don't really care.
I never understood this. It's always seemed worse - in bash/zsh I can tab complete branches/tags etc in git, pods/deployments etc in kubectl. I try that in fish and it'll just list files in my PWD
Though I still write my scripts as bash scripts (with shebang as the first line).
Pair that with tldr and it's a really good experience.
Anyway, have things to do before I can try again and dig in. Thought I'd post in case someone else ran into this.
[Edit] Tip: swap to a different shell before uninstalling your current shell. Sigh...lol
[1] https://github.com/fish-shell/fish-shell/issues/5497 [2] https://raw.githubusercontent.com/Homebrew/homebrew-core/ad5...
tmux.conf [1]
[1] https://gist.github.com/alexpw/7d406734f912f835d705066de8286...
https://github.com/fish-shell/fish-shell/issues/9019
The fish 3.5.0 release is not responsible for my tmux issue. False alarm.
Downgrading did somehow help me regain shell interaction, but I can't create a new session/pane, etc.
I think something else broke my tmux setup during the brew upgrade, or possibly even before it.
If you love bash or zsh, and are in the habit of building long complex commands on the command line, then stick with bash or zsh. But if you are just running commands fish is far superior. If you are not a bash/zsh/posix expert fish is a cleaner language and you'll learn it more easily. A fully tricked out zsh might do everything that fish does, but it is very slow compared to fish.
Fish handles this very ably as well, of course! If you're a developer and you work in or deploy to a lot of environments where you can't install software, choosing what comes with the environment makes sense. But even when it comes to scripting, you won't regret sticking with Fish, imo.