News for hackers. Stuff that matters.
Re:New Features in the Fish Shell by mattgreenrocks on Tuesday September 29, 2020 @04:55PM (#24632863)
The best part about fish is you don't have to configure it much to be productive in it. It is really nice that the fish maintainers think hard about what should be configurable, and what sane defaults should be. This is not as common as it should be in OSS. Contrast with zsh, which has a billion knobs to tweak, and the consensus is that everyone should install a huge "community dotfile framework" (whatever that means) consisting of tons of opaque aliases and settings, some of which might make your shell startup lag.

More to a specific point: I haven't had much of an issue with fish's subshell/backgrounding control. That doesn't mean that there aren't issues, just that my interactive use doesn't trip into them.

I will note that you can write an async git prompt using nothing but fish itself, which I consider an advanced use case for a shell. Check it out:

https://github.com/mattgreen/lucid.fish

Re:New Features in the Fish Shell by nikisweeting on Tuesday September 29, 2020 @06:12PM (#24633637)
I ended up implementing my own background process management for fish here, it uses bash to fork a subshell with fish inside of it, which seems to solve all the problems I encountered.

https://github.com/pirate/fish-functions/blob/master/backgro...

https://github.com/pirate/fish-functions/blob/master/progres...

https://github.com/pirate/fish-functions/blob/master/signal....

https://github.com/pirate/fish-functions/blob/master/fork

Usage:

    background progress_await compiling_task_finished

    g++ ... some slow command

    signal compiling_task_finished
This allows the progress bar to truly run at the same time as the g++ command and receive a signal from the fg process when it's time to complete, something a simple & does not let you do in fish.

I've collected more details on Fish's issues here for anyone interested:

https://github.com/pirate/fish-functions#issues-with-fish

Re:New Features in the Fish Shell by mattgreenrocks on Wednesday September 30, 2020 @09:37AM (#24638557)
I like your semaphore idea a lot! Might be a good primitive to put in fish.
Re:New Features in the Fish Shell by santa_boy on Tuesday September 29, 2020 @11:28PM (#24635421)
Very true. I have been using fish for the last five years without really learning the shell. The auto-complete itself feels so good and makes me productive.

Confession: I haven't taken pains to learn any shell after that. Almost similar to why I never took to try out VSCode after getting used to Sublime Text. So many demos, videos etc. quite tempt me to try out VSCode but still haven't ever got to it)

The only thing that I took note was to install https://github.com/oh-my-fish/oh-my-fish every time I setup a machine.

Would be great to know of any quick to learn fish-hacks or fish-for-dummies resources

Re:New Features in the Fish Shell by mattgreenrocks on Wednesday September 30, 2020 @09:36AM (#24638552)
Most common bash/zsh syntax works in shell. For most day to day shell usage, I'd say:

* get comfortable with stdin/stdout/stderr syntax (and redirection)

* get piping down pat. It's so useful.

* practice using &&, ||, and ; to sequence commands

* know how to use ENV=value to override env vars, and understand how env vars work

* yak shave a bit and make some aliases/functions in your shell based on your usage patterns

From here, it gets esoteric pretty fast, no matter what shell you're in. But you have enough concepts to figure out you need from there.

Re:New Features in the Fish Shell by ernie24 on Thursday October 01, 2020 @05:02AM (#24648913)
As for zsh, I partially agree, but you don't need to go with something heavy like oh-my-zsh. I use prezto, and it's great.
Re:New Features in the Fish Shell by Barrin92 on Tuesday September 29, 2020 @10:07PM (#24635088)
and if you need to configure something, it actually has a really pleasant ui that can be called with `fish_config`.