Live data from Hacker News

The fish shell is amazing

rmpr.xyz

141–150 of 302 posts

Re: The fish shell is amazing

#141

Shells and scripting languages are different things. I don't care how good of a scripting language Powershell is, it's painful to use as a shell. I don't care that fish can't run sh scripts, I've never used it on a machine that didn't have sh. Can we stop judging oranges for their lack of crunch?

It's pretty common to copy-paste POSIX sh one-liners, or `source` a simple script. fish makes this annoying to do.

[deleted]

Re: The fish shell is amazing

#142

Don't forget that if you use #!/bin/sh in POSIX compatible scripts, you can configure /bin/sh to symlink dash shell instead of bash or zsh. Dash will run scripts way faster (up to 4x) because it is less feature blown... This is the reason, why I try to prevent using bash/zsh exclusive features in my daily use scripts.

I use `#!/usr/bin/env sh` in my scripts to avoid having to overwrite a systems defualt /bin/sh and whatever issues that can result in. Instead, I have ~/.local/bin in PATH with dash symlinked to ~/.local/bin/sh

Re: The fish shell is amazing

#144
post #137

Earlier quoted context omitted.

where does one put an alias ? i have a collection of them in my .zshrc that i would love to use.

they're just functions so they end up in files in ~/.config/fish/functions/ $ alias foo bar $ function foo --wraps bar --description 'alias foo=bar' bar $argv end these two are basically equivalent. you'll need to $ funcsave foo to make it persist. this will write foo.fish into that functions folder. there's also abbreviations like $ abbr --add ll ls -lh which expand as you type. ll won't end up in your history becau…

Abbreviations are actually brilliant! So much better than aliases. Long live fish.

Re: The fish shell is amazing

#145
post #102
post #92

Earlier quoted context omitted.

PowerShell is definitely way more capable a scripting language, but it pales in comparison to Fish when it comes to speed, ease, and pleasantness of interactive use. There's a new generation of shells on the rise which look up to both Fish and PowerShell as models of different virtues they want to embody. A lot of them are already usable, and some day a few of them will be killer apps for developers and sysadmins

Nothing is speedier, easier, or more interactive than Get-Help in Powershell. https://docs.microsoft.com/en-us/powershell/module/microsoft... Using other shells is like living in the stone age. I don't know why people would do that to themselves.

Get-Help is pretty good, but I don't like several things about it:

1. You have to go out of your way to fetch the full help pages on a given PowerShell installation (they're not stored locally by default).

2. Even after you fetch the full help, not all of it is actually included in the Get-Help output (IIRC examples), so you often need to use `Get-Help -Online`, which opens a separate application (browser) and that sucks

3. Inside the terminal, there's little to no special formatting or syntax highlighting, unlike what you get with a good `man` pager

4. Get-Help output (unlike `man` output as configured on most distros) is not paged by default.

`man` could be better, and I don't really vibe with `info`, but Get-Help isn't that great imo. The actual content of the help is quite good, and it's nice that it includes examples, but the same is true of most man pages.

Re: The fish shell is amazing

#146

Shells and scripting languages are different things. I don't care how good of a scripting language Powershell is, it's painful to use as a shell. I don't care that fish can't run sh scripts, I've never used it on a machine that didn't have sh. Can we stop judging oranges for their lack of crunch?

[deleted]

Re: The fish shell is amazing

#147
post #7

I used fish for a couple of years and really liked it. But I recently learned that I can configure ZSH to have all of the same auto-complete and plugins that I loved from fish. Now I have all of the creature comforts I like, with POSIX compliance I found that while fish has better syntax than bash for most things, the hassles with incompatibility or unexpected behavior brought me much more trouble than BASH's syntax…

The best reason to choose fish over zsh is that everything works so well out of the box that you stop messing with it. I haven’t tweaked my shell config in 7 or 8 months now. This is a different mindset from the giant zsh configs, “plugin managers” and other junk that is wholly irrelevant to using the shell. You’d think that fish incorporating a lot of functionality that zsh has would manifest as bloating fish, but,…

Another issue with zsh plugins is that they are incredibly slow. Oh-my-zsh makes every terminal feel like it’s running on another machine over ssh

Re: The fish shell is amazing

#148
post #109
post #89

Earlier quoted context omitted.

> I would strongly not advise to make it the default shell though as this can lead to issues. I've heard this a lot, but I've been using Fish as my login shell for many years, and it's really not a problem I think maybe some vim plugins call out to your $SHELL or something, but assume that it's bash-like? but I've never run into a serious issue with just using Fish as my login shell

I don't remember the root cause as it was a while ago now, but in my case I couldn't login on a TTY because of that.

That would be a nightmare for sure. I can't blame you for being cautioned by an experience like that.

I've been running Fish as my login shell for almost 10 years now, on Linux and then additionally for ~4 years for intermittent macOS usage (only at work) without issue.

I don't really like launching Fish from ~/.bash_profile because or similar because I don't like having to type `exit` twice to exit, and `exec`ing into Fish leaves you in one shell but with your $SHELL variable set to another.

But if that works for you, more power to ya, and it's good for Fish users to know that that's an option if they run into issues using Fish as a login shell.

Re: The fish shell is amazing

#150
post #147

Earlier quoted context omitted.

The best reason to choose fish over zsh is that everything works so well out of the box that you stop messing with it. I haven’t tweaked my shell config in 7 or 8 months now. This is a different mindset from the giant zsh configs, “plugin managers” and other junk that is wholly irrelevant to using the shell. You’d think that fish incorporating a lot of functionality that zsh has would manifest as bloating fish, but,…

Another issue with zsh plugins is that they are incredibly slow. Oh-my-zsh makes every terminal feel like it’s running on another machine over ssh

And that delay when it updates itself is just the worst
Post reply on HN