Live data from Hacker News

Fish shell 3.0

github.com

141–150 of 227 posts

Re: Fish shell 3.0

#141

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…

URL pasting is indeed annoying. That said, second-guessing the user's input is dangerous territory, which is why no shells do what you describe by default. The way we plan to address this in fish is to make ? an ordinary character instead of a wildcard. Then URLs will have nothing to escape. You can opt into this change today by setting the 'qmark-noglob' feature flag: set -U fish_features qmark-noglob now ? no longe…

How is parsing "^https?://." a second guessing? It's a URL.

Re: Fish shell 3.0

#142
post #80
post #69

Earlier quoted context omitted.

ZSH seems to have broader community support and there's a plugin for basically everything. This is why I chose to stick with it over Fish. If I just wanted a very simple shell, with good defaults, I'd choose Fish. But much like why I use (Neo)Vim I prefer the DIY approach and have gotten my ZSH to the point over the years (and a hundred scripts later) where I love it. But ZSH the language is pretty awful and non-intu…

Similar story for me, but I consider the POSIX shell language a worthwhile least-common-denominator language. I avoid using bash or zsh extensions except interactively (and in a zsh plugin I maintain [0]). As I think you need to know the standard shell language anyway, new shell DSLs are a bit of a turn-off to me. If the language is trivial it's not very powerful and if it's powerful it takes time to learn. That's wh…

Quick correction, the actual url for Xonsh is http://xon.sh. My understanding is that xonsh.org is an out-of-date unaffiliated mirror that the author of Xonsh doesn't control :(

Re: Fish shell 3.0

#143

I like fish's auto completion speed and smoothness but one thing that has held me back when I checked out fish was that there didn't seem to be a `Ctrl+r` command that bash and zsh provide to quickly go through history commands.

You start typing what you want, then hit the up arrow to fuzzy search back through history.

Re: Fish shell 3.0

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

How can detecting URL go wrong? It starts with an obvious prefix and ends at a line end or a space.

If the URL contained a space that is not URL encoded, that would be user's fault.

Re: Fish shell 3.0

#145

Earlier quoted context omitted.

How would you do something like Python's `x[0:10] + x[10:len(x)]` in a 1-indexed way? [1:11] + [1:len(x)+1]? That's uglier.

You just make ranges end-inclusive, and then it's x[1:10] + x[11:len(x)]. The best of both worlds is when a language provides both end-exclusive and end-inclusive slice syntax, as in e.g. Nim: x[0..<10] is end-exclusive, and it's very clear that it is.

But then you no longer get back 10-1 elements, you get back 10-1+1.

Re: Fish shell 3.0

#146

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

Haven't tried 3.0 yet but it had some gotchas back then that I switched back to zsh when zsh could just do all fish could do with enough customization but kept using fish for shell scripting as it looked more sane than the bash like syntax that is ancient.

Re: Fish shell 3.0

#147
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)

Does yay come default on arch linux?

Re: Fish shell 3.0

#148

Can anyone who's experienced with both fish and zsh comment on reasons fish might be better?

Shell scripting finally feels sane. Just the normal "if" and other basic conditionals make you feel you want to switch.

Some scripting example : https://nicolas-van.github.io/programming-with-fish-shell

(I use zsh as shell, as enough customization can do much of what fish can achieve with bit more stability but maybe they fixed with 3.0 which I haven't tried yet.)

Re: Fish shell 3.0

#149

Does anyone know how it compare to zsh with oh-my-zsh?

Zsh + OMZ is a slow, unconfigurable mess. If you are new to Zsh, avoid OMZ. If you are experienced with Zsh, you already know to avoid it. Fish "just works", and you won't have any lag. It is a delightful beginner experience, too. A Zsh veteran could probably replicate parts of the Fish experience in Zsh, but ultimately they are different tools. I use Fish at home for casual shell stuff, but I write shell scripts in…

I guess I try to switch to fish again as like you said zsh with 10 plugins takes so long to start a shell, like 5 seconds which feels forever when you want to start typing right then, that I now never quit the shell from remote machines but just disconnect from its tmux instance so I can go right back without initializing the shell every time I log in.

Re: Fish shell 3.0

#150
post #44

Earlier quoted context omitted.

Finally! Fish 2.x shows you a message along the lines of "use `and` instead of `&&`", which is infuriating - it clearly knows what I want to do, and refuses to do it. I love fish and use it as my default shell, but I'm glad to see the fish team take a few steps towards bash compat.

That reminds me of the very specific nag messages I get from Python 3 when I don't write parens around parameters for print... do what I want already.

What does someone want if they write "bar = print foo,"? Is it the same if "print" isn't the built-in function?
Post reply on HN