Live data from Hacker News

The fish shell is amazing

rmpr.xyz

231–240 of 302 posts

Re: The fish shell is amazing

#231
Is fish usable for a web/nodejs developer working with the usual libs in the JS ecosystem such as React/Webpack as well as usual github projects?

By that I mean any scripts included in these projects. I have seen only a few scripts though.

Re: The fish shell is amazing

#232
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…

Sadly this is the exact reason I switched away from it. I couldn't copy/paste in commands from coworkers or use common web projects (I'd have to either search for a fish replacement or convert it myself... Or just launch bash/zsh).

Really nice shell though, I hope it gets more traction.

Re: The fish shell is amazing

#233
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…

Any suggestions? I’ve recent switched from vanilla bash to ZSH. I mainly use oh-my-zsh and Power10k. Once again the defaults without much customization.

Better to use zgenom, it supports almost every plugins and faster.

Re: The fish shell is amazing

#234
post #147

Earlier quoted context omitted.

The best reason to choose fish over zsh is that everything works so well out of the box that you stop messing with it. I haven’t tweaked my shell config in 7 or 8 months now. This is a different mindset from the giant zsh configs, “plugin managers” and other junk that is wholly irrelevant to using the shell. You’d think that fish incorporating a lot of functionality that zsh has would manifest as bloating fish, but,…

Another issue with zsh plugins is that they are incredibly slow. Oh-my-zsh makes every terminal feel like it’s running on another machine over ssh

this is probably the git plugin doing a "git status" or similar. Check the "plugins" array in .zshrc

Re: The fish shell is amazing

#235
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…

The best reason to choose fish over zsh is that everything works so well out of the box that you stop messing with it. I haven’t tweaked my shell config in 7 or 8 months now. This is a different mindset from the giant zsh configs, “plugin managers” and other junk that is wholly irrelevant to using the shell. You’d think that fish incorporating a lot of functionality that zsh has would manifest as bloating fish, but,…

I haven't touched my zsh config in years.

Omz != Zsh.

Re: The fish shell is amazing

#236
post #17
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…

Many of the features are also achievable with pure bash with ble.sh ( https://github.com/akinomyoga/ble.sh ).

[deleted]

Re: The fish shell is amazing

#237
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…

It is understated how powerful and ergonomic ZSH is.

I hated Apple, but my opinion changed when I learned how to configure ZSH.

Re: The fish shell is amazing

#238

Earlier quoted context omitted.

I moved from bash => zsh => fish. I wanted reasonable features on my shell, and fish was much faster and needed almost no plugins. The fact that I can write a simple for loop without needing to look up how to do it by far beats the POSIX compatibility, if I need it I can still write a bash script, but when using the shell I don't need to recall where semicolons or `do`, brackets (and how many) go.

Is it that hard to remember a bash for loop? for i in $(seq 1 10) do echo $i done Then you can just replace new lines with ; if writing a one liner. for i in $(seq 1 10); do echo $i; done I guess it isn't as simple as python for i in range(10): print(i) but it's pretty close aside from the variable binding.

As someone dealing with new remote machines on a daily basis, I cannot fantasize about any other shell. Bash is pretty straightforward.

Re: The fish shell is amazing

#239

Earlier quoted context omitted.

I don't get why people expect POSIX compliance from fish. Your interactive shell and your scripting shell can be, should be, and often are, different. I use bash as my default user shell, fish as the default shell of my terminal emulator, and I write scripts for both POSIX sh (dash and busybox ash) and bash. I end up using three different shells with different purposes. Sure, I could use zsh both as an interactive an…

Then you have to learn two languages. And switch from one to another when you need to do some scripting. I don't write shell scripts a lot, I prefer to write python scripts (that are more maintainable and simple to write). But I write complex commands in the shell a lot, for example I may need to convert a bunch of images from one format to another, just use a for loop with imagemagik directly from the command line,…

> Then you have to learn two languages.

Why would I need do to that?

> But I write complex commands in the shell a lot ... It's not rare that I write commands that are more than 5 lines long.

Ah, well, yeah, in that case, you might wanna stick to ZSH. I don't write complex commands on the shell. If it's more than 1 line long, I will make it a script. Multiple lines of commands with, or without, backward slash separators look ugly and unwieldy to me. A text editor like vim would do a far better job handling those 5 lines instead of an interactive shell.

Re: The fish shell is amazing

#240
post #154

Earlier quoted context omitted.

I don't get why people expect POSIX compliance from fish. Your interactive shell and your scripting shell can be, should be, and often are, different. I use bash as my default user shell, fish as the default shell of my terminal emulator, and I write scripts for both POSIX sh (dash and busybox ash) and bash. I end up using three different shells with different purposes. Sure, I could use zsh both as an interactive an…

> Not to mention that zsh shouldn't be used as a scripting shell in the first place. Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts?

> Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts?

I guess there are two reasons

- if the script doesn't need arrays, POSIX sh (dash) scripts will be much faster than bash/zsh scripts

- if you do need arrays, bash is vastly more ubiquitous than any other shell on the planet right now (except POSIX sh). It's installed on almost all Linux distributions by default. I'm not gonna use a ZSH script because I'd have to install ZSH, which seems unnecessary. A good example is tomb, which is a ZSH script for encryption on Linux.

If you're sure that your scripts will always run on macOS, use POSIX sh if you don't need arrays and ZSH if you do need them.

Post reply on HN