Live data from Hacker News

Fish shell 3.0

github.com

21–30 of 227 posts

Re: Fish shell 3.0

#21
post #8

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

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

Re: Fish shell 3.0

#22
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

Fish does not include tons of syntactic shortcuts. We try to keep the syntax fairly free of opaque symbols.

You can use `prevd` and `nextd`, or you can use key bindings, like the default alt-left and alt-right bindings.

Re: Fish shell 3.0

#23

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

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.

Re: Fish shell 3.0

#24

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

awesome! can't tell you the number of times I have slammed into this when copy/pasting.

Re: Fish shell 3.0

#25
post #19

So weird. Last night I ran a bunch of updates and spent some time cleaning up and configuring my laptop. Preparing for the New Year. I tried to upgrade Fish and saw that it hadn't had an update since this time last year. I ended up looking through the release logs and just reading the Fish docs a bit. I never do this. Now, this morning, this is on Hacker News.

It's not weird, it's a cognitive bias: Frequency illusion (or Baader–Meinhof effect): The illusion in which a word, a name, or other thing that has recently come to one's attention suddenly seems to appear with improbable frequency shortly afterwards. https://en.wikipedia.org/wiki/List_of_cognitive_biases

I think it's more like a productive time of year for hackers to get things done :). The week between xmas and new years is always super productive and creative for me... it's quiet and there is a subconscious urge to wrap things up before year end.

Re: Fish shell 3.0

#26
post #22
post #21

Earlier quoted context omitted.

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

Fish does not include tons of syntactic shortcuts. We try to keep the syntax fairly free of opaque symbols. You can use `prevd` and `nextd`, or you can use key bindings, like the default alt-left and alt-right bindings.

How do you go to the nth item of the directory stack? Even bash lets you do this:

    $ dirs -v
    0  ~/baz
    1  ~
    2  ~/bar
    3  ~/foo
    4  ~/spam
Then "pushd +3" will take you to ~/foo. This hardly seems "opaque".

Re: Fish shell 3.0

#27

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

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.

Just because a language knows what you mean to do and can give a specific error messagr doesn't mean that, in general, and specifically, the developers want to commit to supporting && as valid syntax forever.

Perhaps the language creators have plans for future syntax that would not allow what you want. Even if for now the language evidently knows what you mean from the error message.

In this specific case, the developers of fish apparently decided && was good to add.

Re: Fish shell 3.0

#28

The one thing I miss most in fish is subshells, because I love writing things like ( (cd $dir && ./run_prog && cd PKG && ./do_stuff) & ), to run a series of things in the background. Is there any way to do something similar in fish?

I didn't know about subshells. I'm going to be using that all the time now, thanks!

Re: Fish shell 3.0

#29
post #26
post #22

Earlier quoted context omitted.

Fish does not include tons of syntactic shortcuts. We try to keep the syntax fairly free of opaque symbols. You can use `prevd` and `nextd`, or you can use key bindings, like the default alt-left and alt-right bindings.

How do you go to the nth item of the directory stack? Even bash lets you do this: $ dirs -v 0 ~/baz 1 ~ 2 ~/bar 3 ~/foo 4 ~/spam Then "pushd +3" will take you to ~/foo. This hardly seems "opaque".

That's included, just the `~2` shortcut thing isn't.

Re: Fish shell 3.0

#30

Fish Shell has been having some problems implementing process substitution. Last I checked, they tried two approaches: * piping to FIFO files, but it throws an error if you pump too much data into them * waiting until one process finishes before starting another. That's not a correct implementation either Bash apparently resorts to black-magic.

The Bash manual seems to imply that they use /dev/fd to implement process substitution like regular pipes, but passing the pipe file descriptor as its filename under /dev/fd.

https://www.gnu.org/software/bash/manual/html_node/Process-S...

Post reply on HN