Remix.run Logo
nkydr0i0 4 days ago

True! lots of people sleeping on Fish. Probably because it's not POSIX compliant -- which is something I was hesitant about at first, too. My favorite features are: built-in vim mode, alt+s instead of sudo !!, backwards search with arrow-up, overall good default settings

cedilla 4 days ago | parent | next [-]

Fish was weird at first, with it's insistence on `or` instead of `||`, and `and` instead of `&&`. Since they relented on this, there's not much non-POSIX weirdness for me. From time to time I'll try to `export` something, but fish just reminds you what to do instead. 3rd party integration is excellent now, too.

When I write scripts I'll just target /bin/sh, or /bin/bash if necessary. Never saw a reason to write zsh or fish scripts.

SAI_Peregrinus 3 days ago | parent | next [-]

Note that `/bin/bash` isn't guaranteed to exist, even if Bash is installed. `/usr/bin/env` is guaranteed to exist on POSIX systems, so `/usr/bin/env bash` is the generally recommended way to invoke it in a shebang. `/bin/sh` is guaranteed to exist on a POSIX system, but `/usr/bin/env sh` can be used for consistency.

kstrauser 3 days ago | parent | prev | next [-]

Export works now.

I write most of my local-use scripts in fish now. Having access to all the little ergonomics like outputting colored text is just more pleasant.

maleldil 3 days ago | parent | prev [-]

Note that `or/||` and `and/&&` are not interchangeable. They have different precedences.

benrutter 4 days ago | parent | prev | next [-]

100% this! I tried fish, loved it, then didn't use it for about a year becayse I'd convinced myself posix compliance was important. The truth is day to day I use 5 or less shell language primitives, mostly I run other programs from the shell, and pipe them into each other, so the shell language compliance doesn't matter.

stavros 3 days ago | parent | prev | next [-]

I don't understand this reticence about POSIX compliance. When would you need your shell to be POSIX compliant? I've been using fish for ten years and I've never had an issue, even with scripting. If I need to run a script, it always has bash in the shebang line, so it runs normally.

Am I missing something useful?

SAI_Peregrinus 3 days ago | parent [-]

Other people's scripts in projects where you can't or don't want to edit the scripts to add a shebang line.

stavros 3 days ago | parent [-]

You can only run those with `bash script` anyway, your shell doesn't matter in that case.

yonatan8070 4 days ago | parent | prev | next [-]

If you work with a lot of longer commands, you can press Alt+e to edit the current prompt in $EDITOR, so you can use your favorite editor to do whatever you'd like to the command.

valeena 3 days ago | parent [-]

I had no idea about that! You and other commenters taught me some great features! I so love fish!

hyperhopper 3 days ago | parent | prev | next [-]

Oh-my-zsh adds most of that while still being POSIX compliant

zwarag 3 days ago | parent | next [-]

In my personal experience, oh-my-zsh slows down things too much. You're better off just taking whatever you really like about oh-my-zsh and configure it yourself.

bbkane 3 days ago | parent [-]

This is what I do: https://github.com/bbkane/dotfiles/tree/master/zsh

Works great!

theshrike79 3 days ago | parent | prev [-]

"zsh is just fine, you just need to add a megabyte of scripts on top" is not a good advertisement :)

warwren 3 days ago | parent | prev [-]

This whole time I didn't know you're supposed to use alt+s. I just got mad sudo !! didn't work. Thanks!