Live data from Hacker News

The fish shell is amazing

rmpr.xyz

151–160 of 302 posts

Re: The fish shell is amazing

#151
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.

zinit did wonders for my config, would highly recommend:

https://github.com/zdharma-continuum/zinit

Re: The fish shell is amazing

#152
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,…

> 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've found that sometimes the opposite can be true (in a good way!). At one workplace, I introduced Fish to some fellow developers who until then mostly saw using the command line as a strange, difficult, and unpleasant part of their jobs.

Once I got them started with Fish, they were happy enough with default interactive behaviors, convenient documentation, and simple scripting syntax that it encouraged them to do a little more scripting, and eventually to customize some of the aesthetic stuff by writing custom prompts!

It was pretty cool to see.

Re: The fish shell is amazing

#153
post #55

Earlier quoted context omitted.

Interestingly I moved from such a zsh setup to fish a couple of years back. Zsh with add-ons was noticeably slow compared to fish and syncing the config to all the devices I used.

ZSH plus oh-my-zsh cd’ing into a git repo with large LFS files will hang your shell even on very fast NVME storage.

I found that all I really wanted to show was the current branch, which I do with https://gist.github.com/ivan/79de5e87210e8cf21e305bb4c30c436...

Re: The fish shell is amazing

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

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?

Re: The fish shell is amazing

#155
post #60

Earlier quoted context omitted.

Zsh has become an indispensable power tool for me. I am interested in other shells (especially PowerShell), but Zsh is now embedded deep in my brain, next to Vim and Python, and I doubt I will ever seriously migrate away. That said: what do you like about Nu shell specifically?

> what do you like about Nu shell specifically? A whole bunch of things: 1. abandonment of POSIX shell syntax. We can do better. I'm happy with Zsh being POSIX-compatible, and that will always be there. 2. a focus on structured data. Nu basically has hierarchical dataframes built-in, along with lots of facilities for their manipulation. There have been a few other attempts at this but the benefits are obvious. Rather…

> A whole bunch of things:

I appreciate the clarity of your message... curiously enough all the things that you mention I see them as anti-features of nushell (except the first one)

1. Posix shell is clunky has its limitations but there's nothing really flawed about it. It is nice to have non-posix shells, though; in that I agree with you.

2. I hate hate hate the very concept of dataframes. They seem like a useless over-engineering. Plain tabular data is a perfect, and the columns of a table are always named 1, 2, 3. The whole point of abstraction is that you do not care about the meaning of the columns of your table, and the programs (like the lovely awk) that deal with these columns do not care either. There's nothing more "orthogonal" than that: filters that do not understand the data but can filter it anyway.

3. syntax highlighting is a very personal issue; in my case I prefer my terminal not to look like a christmas tree.

4. xargs is one of my favorite tools (alongside gnu make and gnu parallel) and there's nothing "unserious" about it. The happiest moments in my programming life are when I get to use these tools. Not using xargs sounds like a nightmare!

5. Rust is definitely an anti-feature to me: it's like a language that was built by picking the worst features of many already ugly languages. I would not really care in what language the shell is written, but I'd rather have it written in saner, "unsafe" languages.

Re: The fish shell is amazing

#156

Is no one going to comment on for *.pdf assumes no spaces in filenames for the BASH example to be correct, what about Fish?

Fish doesn't do automatic word splitting on variable substitutions like bash does. Like ZSH (afaik), Fish doesn't require you to religiously surround every variable substitution in double quotation marks in case the contents have a space.

Re: The fish shell is amazing

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

[deleted]

Re: The fish shell is amazing

#158
post #148
post #109

Earlier quoted context omitted.

I don't remember the root cause as it was a while ago now, but in my case I couldn't login on a TTY because of that.

That would be a nightmare for sure. I can't blame you for being cautioned by an experience like that. I've been running Fish as my login shell for almost 10 years now, on Linux and then additionally for ~4 years for intermittent macOS usage (only at work) without issue. I don't really like launching Fish from ~/.bash_profile because or similar because I don't like having to type `exit` twice to exit, and `exec`ing in…

Now that you say that, that's funny as I do not have to exit twice. I don't know why though as it seems that it should be the case.

Re: The fish shell is amazing

#159
post #8

I used Fish for several years before switching over to nushell a few weeks ago. Nushell takes the ideas behind Fish even further by incorporating types other than strings and adding more built-in functionality that’s useful for your average command-line user. I doubt I’ll go back but both are great! Highly recommend Fish and Nushell!

Does nushell have the same kind of autocomplete? That’s what really keeps me using fish

No, at least not out of the box, on Nushell 0.39.0.

Just tried it and there's no

  - out-of-order tab completion
  - preview with left/right arrow completion
  - case-insensitive/smart-case completion

Re: The fish shell is amazing

#160

Earlier quoted context omitted.

Autocomplete is much better. For example, just typing "y" displays "arn start" in gray _after_ my cursor. I can then refine my command, or use right-arrow to accept the suggestion. And this is just one example; fish is full of small usability touches like that. If you need to run a bash script, `bash the_script.sh` still works

Of course you could always just do ctrl+r and cycle through and refine suggestions in bash

The Fish suggestion the GP is describing isn't based on history, although it also autocompletes from commands in your history that way. That's part of the baseline autocompletion functionality of the whole shell, for all command names, local files, etc.
Post reply on HN