Live data from Hacker News

Fish shell

fishshell.com

81–90 of 120 posts

Re: Fish shell

#81

Earlier quoted context omitted.

About 98% of common POSIX shell usage is covered by fish, right down to identical syntax. (Not everything is.) Biggest tip for fish switchers: set fish as your terminal's shell instead of changing your login shell.

what's the difference between the two for the non initiatives?

AFAIK, login shell can be thought of as the default shell anytime you start a shell.

By default your terminal program uses that, but most terminals let you override that to be something else.

Re: Fish shell

#82
post #68
post #64

Earlier quoted context omitted.

I really don’t get this argument. In my shell I don’t type scripts on the prompt. I use fish most of the time as a shell, but I still write bash or even sh scripts, because fish is not installed on most systems. If you run a bash script from fish, it is still executed by bash (because of the shebang).

Even something like # only test if the build succeeds ./build.py && ./test.py didn't work in fish until recently. It used to be 'and' but they recently added && for compatibility. I think redirects and possibly pipelines work differently in fish too, although I don't remember the details. I type those on the command line frequently. I occasionally use loops as well, though when it gets big I do put it in a file.

Redirects and pipes work as you'd expect. Loop syntax is different. The difference in subshell invocation is the thing that sticks out the most: $(cmd) vs (cmd) in fish.

Re: Fish shell

#83
post #3

I did myself a favour, and instead of learning a new shell read through grymoire's POSIX shell tutorial: https://www.grymoire.com/Unix/Sh.html .

I'm a fish user for over 10 years now; for me a big part of the appeal of fish was (and still is) that I could get a much better quality of life without having to train myself to wizard-level with the less ergonomic but ubiquitous bash. I'm sure any black belt bash wizard will leave me in the dust on every metric, but that's fine, I don't need my shell environment to be super optimized for maximum effectiveness, it j…

I'm glad that you are happy with your setup. Every one of us is so special that there could be no one size fits all solution. The reason I started going back to bash and to some extent POSIX shell is a simple question which I nowadays ask myself: do I know why I am using this? or: do I _really_ need this? When I lack a strong reason for picking up something, I drop it, and when I can live without learning a new tool, I do it.

Re: Fish shell

#84
post #16

So the massive drawback of fish is it's incompatible with bash (and other shells people use). If you're in fish, this is easily remedied because almost every machine has bash too. However, you can't expect another machine to have fish. However, I just really like fish. I also live out of my own shell, and I don't spend much of my life remote-ing into other machines. When I do, my mind flips into bash just as easily a…

I think this warning is actually harmful: Years ago, I read this argument about fish and it turned me completely off using it. Only more recently have I really realised this never applied to 99% of my (most people's?) use-cases. The logical step many people miss is that shebangs make the compatibility of the user's shell largely irrelevant: the only real compatibility concerns are the bash version or `sh` aliasing on…

> The logical step many people miss is that shebangs make the compatibility of the user's shell largely irrelevant: the only real compatibility concerns are the bash version or `sh` aliasing on the user's system.

It's a huge problem if you have stuff that is expected to be sourced into the shell rather than executed as a script., for example, because the sourced stuff provides a large API of functions.

Re: Fish shell

#85

Earlier quoted context omitted.

I think this warning is actually harmful: Years ago, I read this argument about fish and it turned me completely off using it. Only more recently have I really realised this never applied to 99% of my (most people's?) use-cases. The logical step many people miss is that shebangs make the compatibility of the user's shell largely irrelevant: the only real compatibility concerns are the bash version or `sh` aliasing on…

> The logical step many people miss is that shebangs make the compatibility of the user's shell largely irrelevant: the only real compatibility concerns are the bash version or `sh` aliasing on the user's system. It's a huge problem if you have stuff that is expected to be sourced into the shell rather than executed as a script., for example, because the sourced stuff provides a large API of functions.

In my experience, the only time I do this is with files that have been provided explicitly for my shell of choice.

The only exception to this that I see regularly is shell installers auto-adding some directory to the PATH env by making automated changes to bash/zsh confs in $HOME. This may be a slight annoyance for some, but tbh I like it as having to manually paste in a PATH addition myself allows me to audit them (and it's still quick enough).

Re: Fish shell

#86

My FISh setup: Fish + oh-my-fish + theme-bobthefish + powerline modified fonts One of Fish’s features I like the most is a per-directory command history stack, on top of the normal history stack.

> a per-directory command history stack

I’ve used Fish for years and always suspected it offered command history by directory. Fish really “just works” so I never felt the urge to investigate and verify my suspicion.

Re: Fish shell

#87

Anyone using fish in Vim mode? Does it work well? Last time I tried I had not such a good time. Would love to see a tutorial on how to use it efficiently.

It interacts pretty poorly with, e.g., terminals in IDEs, but is essential for my day to day in my regular terminal emulator. Worth noting I'm not a vim power user, but I could live without vim keybindings for moving around, it just feels more naturally.

Re: Fish shell

#88
post #28

I love Fish, pairing it with Starship prompt ( https://starship.rs ) makes a truly powerful combo with almost no extra config necessary.

Add ranger to that, it’s a very simple and lightweight TUI file manager

Re: Fish shell

#90
post #2

Previously: https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

This shouldn't be downvoted. I don't think that this person is necessarily complaining that it was reposted; rather it's sometimes nice to be able to go back and see previous discussions.

Exactly, thanks. There's plenty of gold in those old threads.
Post reply on HN