Live data from Hacker News

Fish shell 3.0

github.com

81–90 of 227 posts

Re: Fish shell 3.0

#81
My favorite feature of fish is `abbr`, e.g. `fish abbr --add g git`. Then you type `g` followed by space and it just expands it to `g` and you then get all the autocomplete goodness and don't have to futz with adding autocomplete support to an alias, because it is the real command. It also helps for presentations because instead of some obscurely named alias, you can type an abbreviation and it just expands it out for the viewer to see and learn from. On top of that, I make abbreviations with long options, that way I can see exactly what is going on and effectively edit the commands.

Re: Fish shell 3.0

#82
post #50

Earlier quoted context omitted.

Though I've really grown toward the 'everything as a function' pattern that Fish is trying to do, this is definitely a step back in the right direction. I might even wish for `$()` to be supported as well to allow even better copy pastable oneliners from Bash.

Your quoting is a bit confusing, as "`cmd...`" and "$(cmd...)" are similar,, while backtick-dollar-paranthesis is just asking for trouble... ;) I take it fish didn't / doesn't support either?

Fish just uses (cmd), no $.

Re: Fish shell 3.0

#83
post #58

Apart from the other good stuff in this release, I think this will make a lot of things much easier: fish now supports && (like and), || (like or), and ! (like not), for better migration from POSIX-compliant shells

That’s new? Suddenly I feel less guilty about dodging coworkers who have been trying for years to get other people to try fish. But maybe now it’s getting closer to production readiness.

If you feel productive with your current shell, stick with it, it is definitely a performance hit when switching shells. That being said, if you have a weekend, go for it, I won't switch back.

Re: Fish shell 3.0

#84
post #79

Still no auto-escaping or quoting for pasted URLs, that's really disappointing. I respect fish's stated goals of user friedlieness, but I just don't think they've realized that goal in ways that other more mainstream shells have: > mpv https://www.youtube.com/watch?v=LBoF1e5YDdQ fish: No matches for wildcard 'https://www.youtube.com/watch?v=LBoF1e5YDdQ'. See `help expand`. mpv https://www.youtube.com/watch?v=LBoF1e5Y…

What? That's been in for a few releases! To trigger it, enter a single-quote, then paste the URL, then close the quote once you're done. We don't attempt to detect URLs because that can go wrong, and because we don't know your intention. So we use the fact that you're inside single-quotes as the signifier that we should escape things - which also allows this to be used for e.g. pasting shellscript as a literal argume…

I think the post is wanting it to be handled automatically, without having to quote it, that was the intent I got from it.

But yeah, I have had a ton of issues where commands fail because I didn't quote URLs, and in the beginning it wasn't as obvious as it is now. I don't have a solution, just saying that this does add friction for newcomers.

Re: Fish shell 3.0

#85

I made fish my default shell for around a month, and I really liked the smart suggestions of what command I was going for when I started typing. But the "vi" mode had enough incompatibilities that it really irritated me, it was extremely incomplete. Discussions of it with devs went nowhere. Plus, there were incompatibilities in the language that I could never bring myself to commit to memory; I might have if the vi m…

I tried VI mode on Fish for a while but yeah, I just turned it off and have stuck with the default Emacs mode instead. Been much happier since I did that.

Re: Fish shell 3.0

#86
post #33

To install on ubuntu if you don't want to build: sudo apt-add-repository ppa:fish-shell/release-3 sudo apt-get update sudo apt-get install fish https://launchpad.net/~fish-shell/+archive/ubuntu/release-3

To install on Arch (w/yay), `yay -S fish`. (just a plug for how easy it is to install packages on Arch)

Re: Fish shell 3.0

#87
post #21
post #8

Earlier quoted context omitted.

Coming from ZSH, Fish is a shell that just worked out of the box for me. It did everything ZSH did but I didn't have to touch a single configuration file to make it work. With ZSH I was forced to find all the options I wanted enabled and tuned or had to resort oh-my-zsh or templates from others to get all the good stuff. Managing dotfiles across workstations and servers. With Fish about the only thing I do after inst…

With zsh, I can do ~1, ~2 etc to move around a directory stack. Does fish have anything like that? http://zsh.sourceforge.net/Intro/intro_6.html#SEC6

I made a plugin for that. It works well enough for my needs. https://github.com/danhper/fish-fastdir

Re: Fish shell 3.0

#88

Long time zsh user here. Any reason one should try out fish?

Abbreviations!!! No more aliases, abbreviations are the killer feature. See my other comment in this post for an example.

Also, inline function creation, editing and saving are also pretty killer. I make way more one-day use functions than on bash with fish.

Re: Fish shell 3.0

#89

Earlier quoted context omitted.

Starting at 1 is good for non-programmers, who IMO could benefit the most from switching to Fish. I would love to see a distro using Fish as the default shell for non-root users.

When I’ve been teaching people to program, explaining [0] has been a tragic experience. Starting at [0] is not objectively better than [1]. I actually believe it is objectively worse .

I would like to hear your counterarguments to https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E..., which seems to me like a compelling argument.

Re: Fish shell 3.0

#90
post #79

Still no auto-escaping or quoting for pasted URLs, that's really disappointing. I respect fish's stated goals of user friedlieness, but I just don't think they've realized that goal in ways that other more mainstream shells have: > mpv https://www.youtube.com/watch?v=LBoF1e5YDdQ fish: No matches for wildcard 'https://www.youtube.com/watch?v=LBoF1e5YDdQ'. See `help expand`. mpv https://www.youtube.com/watch?v=LBoF1e5Y…

What? That's been in for a few releases! To trigger it, enter a single-quote, then paste the URL, then close the quote once you're done. We don't attempt to detect URLs because that can go wrong, and because we don't know your intention. So we use the fact that you're inside single-quotes as the signifier that we should escape things - which also allows this to be used for e.g. pasting shellscript as a literal argume…

There must be a disconnect here, manually entering a single quote, then pasting my URL, then adding the closing quote is precisely what I wish to avoid.

Here is a demonstration about what I'm talking about: https://i.imgur.com/d64lwaB.mp4

> "We don't attempt to detect URLs because that can go wrong, and because we don't know your intention."

That much I've gathered from seeing this issue raised with fish people in the past, and in my humble opinion it's the wrong approach. In this mentality fish is forgetting it's stated goal of being user friendly which should in some cases, mean making sane educated guesses about the user's intent. How often do users of the fish shell paste a string that starts with 'http' and contains a '?' that is meant to be a wildcard? Not very often at all, if ever; fish is now evidently planning on deprecating that ? wildcard so I think the fish devs agree!

The way I see it traditional shells aren't user friendly because they take a conservative approach, doing crap like not enabling fancy autocompletion features out of the box because "what if the user is running on a timesharing PDP-11 and can't spare the CPU cycles?" Breaking from that mental trap is bold and should be commended, but in the case of not escaping pastes I think fish has fallen into that conservative mindset again. zsh/OMZ does it by default and I've never heard of anybody getting screwed over because of it. Fish could and should do it by default too.

Post reply on HN