Live data from Hacker News

The fish shell is amazing

rmpr.xyz

61–70 of 302 posts

Re: The fish shell is amazing

#61
post #28
post #7

I used fish for a couple of years and really liked it. But I recently learned that I can configure ZSH to have all of the same auto-complete and plugins that I loved from fish. Now I have all of the creature comforts I like, with POSIX compliance I found that while fish has better syntax than bash for most things, the hassles with incompatibility or unexpected behavior brought me much more trouble than BASH's syntax…

This is my problem as well. I’ve been using fish for quite a long time, and I’m still frustrated by weird posix incompatibility.

>I’m still frustrated by weird posix incompatibility.

Can you also share what are the most significant problems with posix incompatibility for you? Why is it a problem?

Re: The fish shell is amazing

#62
> Smart tab completion not only for the commands but for the arguments as well, and it apparently does that by parsing man pages.

And it does this every time you spawn a shell. So if you have set your login shell to fish, then every time you launch a shell it loads all the fish plugins like this one, and that slows it down. And you can’t turn it off, or couldn’t the last time I checked around a year ago. Insult to injury? The PR where this was requested was closed by the devs as “wontfix”.

This, and it’s lack of POSIX compatibility, made me switch back to zsh.

Re: The fish shell is amazing

#63
Shells and scripting languages are different things. I don't care how good of a scripting language Powershell is, it's painful to use as a shell. I don't care that fish can't run sh scripts, I've never used it on a machine that didn't have sh. Can we stop judging oranges for their lack of crunch?

Re: The fish shell is amazing

#64
post #16

As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know Zsh has a short for loop? Along with fantastic plugins like fzf-tab, I don’t see a reason to use anything else right now. Though, I’m keeping a very interested eye on Nu shell. They’re doing a lot of stuff right, and I expect it will become a very useful scrip…

> while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. The point of fish is that there is no configuration required. You don't have to learn to configure it, you don't have to be part of "the community" to learn which plugins to use, you'll be able to sit in front of any fish prompt and have it work as expected without having to move dotfiles around.

That's a cool argument for Fish for beginners. When you spend thousands of hours in a shell that doesn't matter as much. I don't see any benefit for someone who has Zsh set up well, but yes you do have to google once how to configure auto-completion and so on.

Re: The fish shell is amazing

#65
post #31

Earlier quoted context omitted.

bass can be helpful for some of those posix issues: https://github.com/edc/bass Another random tip: python virtualenv generates a activate.fish script that you should use instead of the plain activate script.

Bass has never worked for me, in any scenario. I'm curious to see how you use it. I have never successfully been able to feed it any bash script. At this point I suspect I'm either holding it wrong or it is a thing that is invoked as a thing that works without ever being used in earnest.

bass works for things you're meant to source. If the script is not meant to be sourced, just run bash yourscript.sh .

It basically runs the script in bash, diffs the environment, and applies the environment changes to your outer fish shell. I use it for some internal tools, and previously used it for nvm though I moved from nvm to fnm now which has fish support.

Re: The fish shell is amazing

#66
post #62

> Smart tab completion not only for the commands but for the arguments as well, and it apparently does that by parsing man pages. And it does this every time you spawn a shell. So if you have set your login shell to fish, then every time you launch a shell it loads all the fish plugins like this one, and that slows it down. And you can’t turn it off, or couldn’t the last time I checked around a year ago. Insult to in…

I have been using fish for years. I don't have those issues because I just leave the default as bash and run the fish command manually when I log in. Then if I have some incompatibility (pretty rare) I can just type 'exit'.

Re: The fish shell is amazing

#67
post #31

Earlier quoted context omitted.

bass can be helpful for some of those posix issues: https://github.com/edc/bass Another random tip: python virtualenv generates a activate.fish script that you should use instead of the plain activate script.

Bass has never worked for me, in any scenario. I'm curious to see how you use it. I have never successfully been able to feed it any bash script. At this point I suspect I'm either holding it wrong or it is a thing that is invoked as a thing that works without ever being used in earnest.

If your bash script has a shebang you shouldn’t need bass at all. Fish will read the shebang and just run your script with bash.

The only thing I ever used bass for was this edge case where at work the way we login to AWS is using this Okta AWS integration that prints out a list of export commands.

Since fish isn’t compatible with bash export commands, I just run that command result through bass, which automatically converts them to the fish set -x commands.

If I remember right, I think the reason why the bash script my company made didn’t work is that the export commands that were run in bash weren’t propagated to the underlying fish environment. I was using fish to run a script with a separate shell, so it didn’t affect my environment variables.

Or maybe it was because running exec inside a bash script throws you back into fish which then can’t understand the export command.

I could have definitely done my own thing with sed/awk instead, but I suck at those tools and someone else already implemented the functionality in bass.

    bass exec aws_okta_thing_that_prints_export_commands_to_stdout
(Off the top of my head, I think it was something like that, could be misremembering! And by this comment you might be able to tell that I’m far from an expert on how everything works.)

Re: The fish shell is amazing

#68
post #16

As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know Zsh has a short for loop? Along with fantastic plugins like fzf-tab, I don’t see a reason to use anything else right now. Though, I’m keeping a very interested eye on Nu shell. They’re doing a lot of stuff right, and I expect it will become a very useful scrip…

A recent demo of Nushell given a couple of weeks ago: https://media.handmade-seattle.com/nushell/

Oh wow...finally someone is bringing the great ideas of Powershell to unix. Can't wait to see how this turns out.

Re: The fish shell is amazing

#69

I started a new job recently, and I've been thinking about terminals and shells. I love a well configured modern env, but I can't be bothered spending the literal HOURS you need to setup everything... zsh, zsh plugins, fzf, fzf plugins, fd, dot bare, patched fonts, 24 bit terminal color, temrinal color theme, binutils color theme, powerline, diff-so-fancy... I get that the devil is in the details, but come on, can I…

I stopped using patched fonts because of that. And I never felt like 24 bit terminal colors was necessary. You can just install fish and then the fisher plugin manager and then install a theme/prompt plugin.

Re: The fish shell is amazing

#70

Shells and scripting languages are different things. I don't care how good of a scripting language Powershell is, it's painful to use as a shell. I don't care that fish can't run sh scripts, I've never used it on a machine that didn't have sh. Can we stop judging oranges for their lack of crunch?

Yeah, I hear a lot of people throw shade at fish and then act equally surprised when I don't run my scripts with it. Much like Bash, Perl, Python or even ZSH by some respects, fish is just another tool in my toolbox. It so happens to be the one I default to though, which for some reason sends people flying off the handle.
Post reply on HN