5 ms·
I used fish twice for about a year each time, but I keep switching back to zsh, because: * The main things I like about fish are predictive history completion
by burke 9y ago
I used fish twice for about a year each time, but I keep switching back to zsh, because:
* The main things I like about fish are predictive history completion and syntax highlighting, both of which work about the same with a pair of zsh plugins;
* The syntax occupies what is, for me, an awkward middle ground: it's a bit better than POSIX syntax if POSIX shells didn't exist, but not enough better that I care to juggle the two syntaxes;
* I don't like that fish tries to be "helpful" in certain cases such as lying to you about the delimeter actually used by $PATH.
I have a couple of specific gripes about the syntax, which aren't really inherent issues so much as unimplemented features.
I think if I was going to deviate from a POSIX shell, the alternative would have to be more better than fish to be worth it.
- davemp 9y agoOut of curiosity, what use case do you have that makes a POSIX shell a big deal? I’ve never had issues as a somewhat heavy user.
- alphaalpha101 9y agoIt's nice to be able to simply copy-paste commands from the internet sometimes. (obligatory: yes you have to be careful when you do.)
- burke 9y agoThere's nothing major. I maintain a set of POSIX and fish scripts as part of my job and, given that I have to know both relatively well, I find I end up preferring the on-average-slightly-more-terse POSIX syntax. One thing that can be particularly annoying is that it seems to be impossible in fish to evaluate a command in a subshell and embed its output into a string without assigning it to a variable first. ARGV handling is a little weird too. I understand the impulse to get rid of $1, $2, $3, $*, $@, $#, etc., but it ends up just requiring different gymnastics, like writing `set -e argv[1]` instead of `shift.
- zeveb 9y ago> Out of curiosity, what use case do you have that makes a POSIX shell a big deal? Running on a POSIX system, there are decades' worth of shell snippets out there which don't work with fish, but do with sh, ksh, bash & zsh. Fish is just gratuitously incompatible. Having fish-users on a team is a pain, because they'll write everything in fish and either not bother producing sh equivalents, or produce insufficiently-tested sh equivalents. It's just a lot of pain and bother, and what's the benefit? Zsh does everything fish does and more, so why not just use it? Edit: I just wish that the original fish developers had chosen to implement all their cool features and be sh-compatible, or at the very least had exercised some wisdom in where they chose to break compatibility. Instead, it very much feels like a 22-year-old's project: full of ideas, some good & some bad, and needlessly without respect for the past. I've no problem with rejecting the past when the past is broken (and sh is broken in places); my problem is with the equivalent of saying, 'hey, English spelling is terrible, soh Aiv dəseidid tū dəvelup mai ohn.'
- geoelectric 9y agoBack in the day I used to use csh and tcsh, both of which had famously landmine-laden scripting gotchas. So, I wrote my scripts in sh or bash. Now that I use zsh mostly, same thing, I don't actually write my scripts in zsh--especially for production, I write them in sh or bash. zsh for me is an interactive CLI-only tool. Honestly, I think the problem here sounds more about not standardizing on a common denominator for shared scripts. Where stuff like fish is a pain for me is with apps that for whatever reason need shell integration (virtualenv, for example). Non-POSIX shells end up being an afterthought there, so you end up with no or buggy support, and end up having to find some other custom variant (virtualfish, etc.) to get good behavior. Sticking with a more mainstream shell tends to be safer there, and zsh barely makes it over that line.
- eaceaser 9y agoWhat are the ZSH plugins that you use, out of curiosity?
- burke 9y ago* zsh-autosuggestions: https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions * zsh-syntax-highlighting: https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting * My zshrc, for what it's worth: https://github.com/burke/dotfiles/blob/master/.zshrc#L173-L174 https://github.com/burke/dotfiles/blob/master/.zshrc#L173-L1...
- spinningarrow 9y agoI started with bash, moved on to zsh and finally settled on fish. Besides fish being super user-friendly out of the box, I couldn’t find a zsh plugin that emulated its history search abilities.
- sertorius 9y agoI use the following lines in my .bashrc to search the history based on a half-typed command (taken from https://stackoverflow.com/questions/1030182/how-do-i-change-bash-history-completion-to-complete-whats-already-on-the-line https://stackoverflow.com/questions/1030182/how-do-i-change-...): if [[ $- == *i* ]] then bind '"\e[A": history-search-backward' bind '"\e[B": history-search-forward' fi
- spinningarrow 9y agoThere are two history search features in fish that I really like: One is searching for a half typed command as above, but the other one that I haven’t found elsewhere is completing words from other commands. For example, I can type ‘touch something’ and later on do ‘cat some’ and then press option+up and fish will complete it to ‘something’.
- figgis 9y agoAfter using ZSH I have that first feature and love it. I try to keep as much of my history as possible and it's amazing how much time you can save that way. Does that second feature not clutter up that history though?
- ufo 9y agoIs it possible to configure zsh to have sane variable expansion like fish does? One of my favourite parts of fish is that I don't need to quote every variable I use out of a paranoid fear that they might contain spaces.
- faho 9y agoApparently zsh actually does something similar by default. See http://zsh.sourceforge.net/FAQ/zshfaq03.html http://zsh.sourceforge.net/FAQ/zshfaq03.html.
- tomaskafka 9y ago> * The syntax occupies what is, for me, an awkward middle ground: it's a bit better than POSIX syntax if POSIX shells didn't exist, but not enough better that I care to juggle the two syntaxes; This. It's an awesome shell, but I couldn't set is as a default because my already done shellscripts and aliases would stop working. And I also can't set it on server, because then a deployment tool logs in, and expects bash. And if it isn't default, I might not bother, I'd forget to run it manually most of the time. (The worst offender is replacing && with 'and' - why not at least enable both and preserve compatibility?)