Live data from Hacker News

The fish shell is amazing

rmpr.xyz

181–190 of 302 posts

Re: The fish shell is amazing

#181
post #169
post #82

Earlier quoted context omitted.

You can run PowerShell on Unix already, but imo it is too slow for interactive use. Getting it to act like a Fish makes it very, very slow

But I think it's quite good for scripting. You can call any system command as easily as in bash while being able to use variables for not just strings. I'd never use it as interactive shell, of course :] Also... the script will then run only on my machine as most Linux systems don't have powershell and most Windows don't have the Unix commands I still use all the time.

Yeah, I agree that PowerShell is great for scripting. I don't do that much scripting on my personal Linux systems that really calls for PowerShell, but I like using PowerShell for hitting HTTP APIs or processing structured data at work.

> Also... the script will then run only on my machine as most Linux systems don't have powershell and most Windows don't have the Unix commands I still use all the time.

Hahahaha! Oof.

It's more work, but when I use PowerShell, I try to use pure PowerShell, both for aesthetic reasons (cleanliness, ‘portability’) and just in order to practice and learn more PowerShell APIs along the way.

Re: The fish shell is amazing

#182

I like software where you don't need to spend hours or even days on configuration and it just works out of box. Unfortunately the different syntax is no go for me. I have a bunch of scripts which I can run on my local machine and remote interchangeably. Even if syntax is better I want to learn rather `one syntax` that work everywhere. But that is only one thing that prevents me from trying it.

Maybe it’s a personal quirk but all of my shell scripts have a shebang (#!) header anyway. I’ve used fish as my shell for years and still have so far never written any shell scripts in fish. It may also be a nice scripting language, but I personally use it because it’s a fantastic interactive shell.

Mine even have a #!/usr/bin/env which I never shook due to going back and forth between Linux and FreeBSD at one point (bash isn't where you might expect).

I think i'd be up for trying out a new shell for my command line, it's rare I use shell specific syntax heavily for one liners... unless I just don't know it yet.

Re: The fish shell is amazing

#183
post #60

Earlier quoted context omitted.

> what do you like about Nu shell specifically? A whole bunch of things: 1. abandonment of POSIX shell syntax. We can do better. I'm happy with Zsh being POSIX-compatible, and that will always be there. 2. a focus on structured data. Nu basically has hierarchical dataframes built-in, along with lots of facilities for their manipulation. There have been a few other attempts at this but the benefits are obvious. Rather…

> A whole bunch of things: I appreciate the clarity of your message... curiously enough all the things that you mention I see them as anti-features of nushell (except the first one) 1. Posix shell is clunky has its limitations but there's nothing really flawed about it. It is nice to have non-posix shells, though; in that I agree with you. 2. I hate hate hate the very concept of dataframes. They seem like a useless o…

I strongly disagree about data frames. I am a data scientist professionally, and I think the data frame is one of the most important programming abstractions I use.

Re: The fish shell is amazing

#184
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…

I moved from bash => zsh => fish. I wanted reasonable features on my shell, and fish was much faster and needed almost no plugins. The fact that I can write a simple for loop without needing to look up how to do it by far beats the POSIX compatibility, if I need it I can still write a bash script, but when using the shell I don't need to recall where semicolons or `do`, brackets (and how many) go.

> I moved from bash => zsh => fish

Did the same, but moved on.

Now it is: bash => zsh => fish => nu

Re: The fish shell is amazing

#185

> You can configure your shell using a web interface! Just run fish_config As much as I like the fish shell, I really consider this an anti-feature. A TUI application to configure the shell would make much more sense. The terminal emulator is your platform, not the Web.

Wondering how it would function after being passed through https://github.com/azproduction/html-tui

Re: The fish shell is amazing

#186
post #65

Earlier quoted context omitted.

Bass has never worked for me, in any scenario. I'm curious to see how you use it. I have never successfully been able to feed it any bash script. At this point I suspect I'm either holding it wrong or it is a thing that is invoked as a thing that works without ever being used in earnest.

bass works for things you're meant to source. If the script is not meant to be sourced, just run bash yourscript.sh . It basically runs the script in bash, diffs the environment, and applies the environment changes to your outer fish shell. I use it for some internal tools, and previously used it for nvm though I moved from nvm to fnm now which has fish support.

Hadn't heard of fnm before, thanks. Seems worth checking out.

Re: The fish shell is amazing

#187
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,…

I use fish. I haven’t tweaked my shell config in 9 years

Re: The fish shell is amazing

#188

Is there anyone who can provide a simple summary for bash v zsh vs fish? Maybe I’m lazy but I’ve just stuck with bash for.. well since ever. Maybe it’s time to try something new but then if it ain’t broke… anyway would be interested in what things it does that I never knew I needed or things which just make life simpler/easier.

Autocomplete is much better. For example, just typing "y" displays "arn start" in gray _after_ my cursor. I can then refine my command, or use right-arrow to accept the suggestion. And this is just one example; fish is full of small usability touches like that. If you need to run a bash script, `bash the_script.sh` still works

Zsh does this too...but you have to configure zsh-autosuggestions.

The difference is that fish does this of the box with no configuration.

Re: The fish shell is amazing

#189
post #107
post #74

Earlier quoted context omitted.

Ideally you do want them to be the same, so that the skill of using one reinforces the skill of using the other, and you can begin to shape scripts out of your shell history. Output redirection doesn't work right with Fish functions, which makes them unusable in certain kinds of scripts. Aside from that, though, Fish is perfectly pleasant for simple scripting. I use Fish for simple stuff and PowerShell for anything s…

Agreed. I liked fish last time I tried it (probably over a decade ago), but bash scripting is what I'm familiar with and it's just so convenient in day-to-day usage to be able to throw out one-liners for mundane things and then have them permanently searchable in my history.

I thought Ctrl+R was cool but in fish you are always in search mode! Start typing any part of your previous command and hit up arrow!

Re: The fish shell is amazing

#190
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,…

> The best reason to choose fish over zsh is that everything works so well out of the box that you stop messing with it.

This is such an incredibly odd perspective to me. I use zsh and have not touched my shell config in years. Messing with configurations to get things working to your liking is a one time thing. I don't even use plugins.

On the other hand, if fish doesn't work to your liking out of the box, and for many people it does not, there's no "messing with it" that's possible. You are forced to give up and use something else. Your reason to choose fish is only a good reason if you already agree with every minute choice the developers made and refuse to let you adjust.

Post reply on HN