Live data from Hacker News

Fish shell 3.0

github.com

201–210 of 227 posts

Re: Fish shell 3.0

#201
post #142
post #80

Earlier quoted context omitted.

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 :(

Oh, oops. Too bad I can't edit anymore. Sad that the out-of-date site os ranked better on Google for "python shell".

Re: Fish shell 3.0

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

It's 13 years old it's been production ready for a very long time. Using your preferred syntax != production ready.

Re: Fish shell 3.0

#203

Earlier quoted context omitted.

> Your dismissive attitude towards this is antithetical to the design of user friendly software And your dismissive attitude of the project's own design goals is antithetical to the notion that not everybody has the same priorities as you, nor do they think your personal ideas equate to "the design of user friendly software". The principle of "no surprises" is probably the greatest aspect of "user friendly software"…

>The principle of "no surprises" Is violated by this: > 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=LBoF1e5YDdQ ^ Particularly for software that sells itself as user friendly. The carrot doesn't even point at the wildcard! I am very far from the first person to raise this issue with…

? Soon won't be a special character most urls don't include [] () >|$ seems like the majority of urls will actually work without escaping.

Re: Fish shell 3.0

#204

Earlier quoted context omitted.

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

Operator precedence isn't really a new concept, and Python relies on it in plenty other situations: bar = 1 + 1 I do believe Python made the right call, actually: print needed to be unified with functions, and dropping the requirement for parenthesis for function calls would have introduced so much incompatibility as to make the Python 2 -> 3 transition far more difficult. But ignoring the legacy issue, there is a be…

Haskell/ml/caml do it better than Ruby.

    f 1 2
    (f 1 2).thing
Here the parentheses are nothing special, they just hint precedence.

As opposed to

    f 1, 2
    f(1, 2).thing
Awkward special-case commas and parentheses.

Re: Fish shell 3.0

#205

Earlier quoted context omitted.

Your proposed remedy is for the shell to insert something different than what the user inputs. That is much more surprising. No program works that way.

No program other than a shell requires that a URL copied out of your browser's address bar be escaped. Users may not be accustomed to a program escaping or quoting text they paste, but they're also definitely not accustomed to escaping or quoting strings manually.

How do you propose that people use a shell without learning about escaping.

How many people actually using fish are liable to be confused.

Its a strange world you seem to be describing where people simultaneously prefer to use mpv in the terminal instead of clicking on a link but can't figure out how to quote the url.

You can actually set it up for example in Firefox so you can open a link in mpv instead and skip a step.

You could trivially make a quoted paste function and bind it in fish.

This fixes the problem for you it would seem.

Re: Fish shell 3.0

#206
post #184

Earlier quoted context omitted.

Operator precedence isn't really a new concept, and Python relies on it in plenty other situations: bar = 1 + 1 I do believe Python made the right call, actually: print needed to be unified with functions, and dropping the requirement for parenthesis for function calls would have introduced so much incompatibility as to make the Python 2 -> 3 transition far more difficult. But ignoring the legacy issue, there is a be…

Didn't Ruby borrow it from Perl?

And lisp, just less parentheses

Re: Fish shell 3.0

#207

Something I've been thinking about this week as a vanilla bash user: Does Fish (or zsh, or others) have the ability to maintain some sort of a global command history? I often find myself wanting to run the same command in multiple terminals and currently just copy-paste.

zsh supports this natively (and is the primary reason I switched to it many years ago).

Re: Fish shell 3.0

#208
post #54

Earlier quoted context omitted.

I also do that, often with loops. for ((i=0;i out-$i.log 2>&1 ) & done Can be anything from image processing, video transcoding, file decompression, file system analysis - anything I think may complete faster with some concurrency.

Something like this should do the same thing, I think?: seq 0 3 | parallel "./ad-hoc-operation > out-{}.log" https://www.gnu.org/software/parallel/

With longer expressions, I find the escaping gets tricky. Also gnu parallel has stupid licence problems and the author has told me I can't use it without paying him.

Re: Fish shell 3.0

#209
post #49

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

I much prefer fish to zsh + omz. Most of the functionality is built in, and there are plugins for any missing ones (nvm is a big one).

I never got nvm working for me, so after a few years on fish, I switched back to ZSH just for nvm. Any tips on how to get it working?

I think it had to do bass not working though, so the plugin didn't work. Now that I'm on NixOS I might give it another shot.

Re: Fish shell 3.0

#210
post #190

Earlier quoted context omitted.

You don’t. ;-) Use fish/zsh interactively, sh for simple scripts, Python for the more complex.

Yeah I get that. But this method doesn't help for scripts that need to modify the current session state (such as export session variables). I am guessing here that such scripts are an edge case and most shell scripts can be simply executed with sh.

Could you give a concrete example of a situation you have in mind? If I'm understanding you correctly, then one solution could be to create a small wrapper to exec bash, source your environment-modifying script, and then exec fish. Are you familiar with exec [0]? fish also has an exec command [1].

I've been using fish for years and it hasn't been an issue. You can keep bash installed for any hardcore scripting, and just fish as your interactive shell.

[0] https://stackoverflow.com/a/38581329

[1] https://fishshell.com/docs/current/commands.html#exec

Post reply on HN