Live data from Hacker News

Fish shell 3.0

github.com

171–180 of 227 posts

Re: Fish shell 3.0

#171
post #44

Earlier quoted context omitted.

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?

That usage doesn't get the weirdly specific error message though. It's only the Python2-ish statement that gets one.

Re: Fish shell 3.0

#172
post #45

Earlier quoted context omitted.

It's a python script, using python's http.server. If you're not executing `fish_config` explicitly, nothing is running.

Nice use of the Python http module. Never looked into the function before tbh (didn't expect the server to be running in the shell though). But just did using `funced` (which I just discovered in the changelog, nice feature as well).

It's also great when you need an ad hoc web server:

    python -m http.server

Re: Fish shell 3.0

#173

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…

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.

Re: Fish shell 3.0

#174
post #41

Earlier quoted context omitted.

There's an actual program, usually installed in /usr/bin/time. The shell builtin is not really necessary.

There's an outstanding issue in the github because the binary doesn't let you directly time fish functions. You can do time fish -c '[function]' but that includes the time to launch fish. This, of course, wouldn't matter for any reasonable usecase but I like a fancy prompt and don't like waiting for it to run.

Ah, timing other shell functions is a use case I hadn't considered. Yes, then you're out of luck I suppose.

Re: Fish shell 3.0

#175

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…

That is not surprising in any way. It is very clear and defined that a question mark is a wildcard, and will be expanded. If you want a literal string, define it as such with a single quote.

Re: Fish shell 3.0

#176
post #149

Earlier quoted context omitted.

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.

This is also a result of bad plugin design.

Functions should be on fpath, zcompile'd, and loaded with autoload. Otherwise you have to read and parse 100s of lines of code every shell invocation... yikes.

Re: Fish shell 3.0

#177
post #67

Let me know when it's posix compliant.

As soon as your bash scripts run with /bin/sh. You can still have bash installed and anything that requires significant scripting could probably be done easier with a language for scripting. I want my shell for my terminal. This is also the reason I don't like the verbosity of Powershell, however much an OOP paradigm better supports scripting.

You can write scripts in the semantics-preserving common subset of POSIX sh and bash, which is not quite, but close to exactly POSIX sh.

It's a widely-touted meme that scripting is more easily done in a general-purpose language than in a shell, but this is mostly true of the (common!) category of tasks which use the shell to launch sed &c. to perform string processing which is built-in in general-purpose languages. It's comparatively hard (i.e. verbose and error-prone) to replace a shell language with a general-purpose language in its core competence, viz. launching processes, muxing I/O, and coordinating parallel processing.

Re: Fish shell 3.0

#178

Earlier quoted context omitted.

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?

No, but I'll say that it is the single coolest feature of Arch, and I think it should be default. I have been able to install every single package with a `yay` command except for one.

My instructions I have for installing yay are:

Go to https://github.com/Jguer/yay/releases Download the yay release and extract it, a clone won't have the build files, download the release. cd to the extracted copy ./yay yay (install the AUR copy of yay using your local copy of yay)

Then `yay -S ` and done, it grabs the repo if it has to and runs the build steps to build from source. It is the most frictionless package management experience I have every experienced on Linux.

And I have used `apt-get` on Ubuntu for many (10?) years (go find the PPA yourself dammit) and also `yum` RHEL7 for the past year. Fedora and Debian need something like this too.

Re: Fish shell 3.0

#180

Earlier quoted context omitted.

It seems to be mostly about math, with the only mention of array indexing being that 0 looks nicer. "starting with 0, however, gives the nicer range 0 ≤ i This doesn't seem to be much of an argument so I'm not even sure what to address.

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.

Others have already given examples of how languages with 1-indexed arrays handle this without awkwardness: end-inclusive ranges. I'll just add that end-inclusive ranges are the standard in natural language as well. For example: "Ages 2-4," "please read pages 16, 20 to 25, and 28 to 29," "1941-1945."

0-based indexing makes sense to me in C where arrays are just pointers and the index is an offset, and doing pointer math is a regular part of the programming experience. But most languages have come a long way from that, and collections such as arrays are much closer to a natural metaphor (a list of things). As such, natural ranges (inclusive) seem more appropriate to me.

Post reply on HN