The fish shell is amazing

The fish shell is amazing

301 comments

·November 25, 2021

jonfw · 10 days ago

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 ever has

mattgreenrocks · 9 days ago

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, IMO the reality is that zsh’s “bloat” is pushed into user configuration and the user is tasked with making it work.

pxc · 9 days ago

> 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've found that sometimes the opposite can be true (in a good way!). At one workplace, I introduced Fish to some fellow developers who until then mostly saw using the command line as a strange, difficult, and unpleasant part of their jobs.

Once I got them started with Fish, they were happy enough with default interactive behaviors, convenient documentation, and simple scripting syntax that it encouraged them to do a little more scripting, and eventually to customize some of the aesthetic stuff by writing custom prompts!

It was pretty cool to see.

resonious · 9 days ago

Even less ergonomic shells like bash can work very well out of the box if you just train yourself to use them. If you train yourself to use bash without any plugins, you'll be strong on any machine without any config.

I went through a "distro hopping" phase at some point with Linux and ended up settling on a system with very little custom config. It's close to the defaults so I can work very comfortably even in a random server.

Of course this is not ideal. If you have a tool or set of config that you like, then you should use it. I've just found that the human brain can overcome bad UX quite well with a little effort ;)

II2II · 9 days ago

There are other benefits to your approach. Relatively little time is spent configuring software and it tends to be easier to copy over a handful of simple configuration files than to replicate a complex setup.

wyclif · 9 days ago

What I do on Linux is keep bash with a minimal config, and then have zsh with oh-my-zsh and all the other goodies. I used bash for a long time, so I don't get too confused by context switching.

bscphil · 9 days ago

> 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.

OJFord · 9 days ago

> 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.

What do you want to do that isn't possible? I also haven't messed with it in months if not more (fish in my case, not zsh) but years ago I messed with the prompt a lot to get it to my liking. (From a previous zsh config.) It was perfectly possible.

shakna · 9 days ago

> 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.

Which part of fish makes this impossible? You can tweak the startup, the completions, the key bindings, the prompt, and so on.

NavinF · 9 days ago

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

rubyist5eva · 9 days ago

Ditch omz and use Prezto with the Powerlevel10k prompt (just change the theme in the zpreztorc file to 'powerlevel10k' and restart your terminal), follow the initial prompts for setup, with "instant prompt" enabled and you'll never go back.

gjvc · 9 days ago

this is probably the git plugin doing a "git status" or similar. Check the "plugins" array in .zshrc

alerighi · 9 days ago

You don't need that much plugins at all. The only plugin that I use is gitstatus, and zsh-syntax-highlight, and both of them are avoidable without loosing features.

RMPR · 9 days ago

And that delay when it updates itself is just the worst

smohare · 9 days ago

This is the framework, not the plugins.

pmarreck · 9 days ago

I thought there was something in, like, Powerman10k or something, which managed to avoid that issue?

AlphaSite · 8 days ago

I use starship and it’s been pretty great and very fast.

favadi · 9 days ago

It sounds like oh-my-zsh issue, not Zsh.

canjobear · 9 days ago

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

tekknik · 8 days ago

Not to mention the speed of fish vs zsh launching is quite noticeable, zsh taking a second or so longer to launch

Lhiw · 9 days ago

I haven't touched my zsh config in years.

Omz != Zsh.

dietr1ch · 9 days ago

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.

macromagnon · 9 days ago

Is it that hard to remember a bash for loop?

  for i in $(seq 1 10)
  do echo $i
  done
Then you can just replace new lines with ; if writing a one liner.

  for i in $(seq 1 10); do echo $i; done
I guess it isn't as simple as python

  for i in range(10): print(i)
but it's pretty close aside from the variable binding.

shakna · 9 days ago

Bash has some subtleties around loops that can be frustrating, like the body of your loop _may_ actually be running in a subshell (common when iterating over a file), making it difficult to extract what you want from it.

alerighi · 9 days ago

In zsh you can avoid the do if you have a single instruction:

    for i in {1..10}; echo $i
to me is as clear as the python version. Very compact and useful for one liners.

ulam2 · 9 days ago

As someone dealing with new remote machines on a daily basis, I cannot fantasize about any other shell. Bash is pretty straightforward.

yesenadam · 9 days ago

  for i in {1..10}

tekknik · 8 days ago

And look at all of those finger bending symbols!

thibran · 9 days ago

> I moved from bash => zsh => fish

Did the same, but moved on.

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

stevage · 9 days ago

What did you prefer about nu?

ayushnix · 9 days ago

I don't get why people expect POSIX compliance from fish. Your interactive shell and your scripting shell can be, should be, and often are, different.

I use bash as my default user shell, fish as the default shell of my terminal emulator, and I write scripts for both POSIX sh (dash and busybox ash) and bash. I end up using three different shells with different purposes.

Sure, I could use zsh both as an interactive and scripting shell but I don't have the time or willingness to configure it when fish offers a nice out of the box experience. Not to mention that zsh shouldn't be used as a scripting shell in the first place.

alerighi · 9 days ago

Then you have to learn two languages. And switch from one to another when you need to do some scripting.

I don't write shell scripts a lot, I prefer to write python scripts (that are more maintainable and simple to write). But I write complex commands in the shell a lot, for example I may need to convert a bunch of images from one format to another, just use a for loop with imagemagik directly from the command line, then maybe a regex with sed to rename them, and done. It's not rare that I write commands that are more than 5 lines long.

With all the quirks of POSIX shell scripting languages (well in reality I use zsh that is nicer) they let you hack things together fast, and that makes them powerful.

ayushnix · 9 days ago

> Then you have to learn two languages.

Why would I need do to that?

> But I write complex commands in the shell a lot ... It's not rare that I write commands that are more than 5 lines long.

Ah, well, yeah, in that case, you might wanna stick to ZSH. I don't write complex commands on the shell. If it's more than 1 line long, I will make it a script. Multiple lines of commands with, or without, backward slash separators look ugly and unwieldy to me. A text editor like vim would do a far better job handling those 5 lines instead of an interactive shell.

tekknik · 8 days ago

> Then you have to learn two languages. And switch from one to another when you need to do some scripting.

The more languages you know the more valuable you are. I prefer to only write golang but sometimes that leads to typescript, Makefiles and bash scripting as well.

pxc · 9 days ago

> Not to mention that zsh shouldn't be used as a scripting shell in the first place.

Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts?

ayushnix · 9 days ago

> Why not? If I'm writing scripts for automating configuration on modern macOS, for example, where ZSH is installed by default, why not write ZSH scripts?

I guess there are two reasons

- if the script doesn't need arrays, POSIX sh (dash) scripts will be much faster than bash/zsh scripts

- if you do need arrays, bash is vastly more ubiquitous than any other shell on the planet right now (except POSIX sh). It's installed on almost all Linux distributions by default. I'm not gonna use a ZSH script because I'd have to install ZSH, which seems unnecessary. A good example is tomb, which is a ZSH script for encryption on Linux.

If you're sure that your scripts will always run on macOS, use POSIX sh if you don't need arrays and ZSH if you do need them.

R0b0t1 · 9 days ago

It's more "why not write scripts?" Actually making use of a shell's control structures is code smell until we have far better shells than we currently do. They're optimized for user interaction, not necessarily anything else.

xkgt · 9 days ago

I am a fish shell user, but for me the biggest drawback is that a lot of tools rely on updating bashrc as part of installation and some of them don't have an equivalent `config.fish`.

ayushnix · 9 days ago

> ... a lot of tools rely on updating bashrc as part of installation and some of them don't have an equivalent `config.fish`

such as?

Aloha · 9 days ago

Exactly this.

I script in bash (though I'm super interested in oil), and use fish as my interactive shell, it's pinned to screen 0 in my screen session.

Macha · 9 days ago

Interestingly I moved from such a zsh setup to fish a couple of years back. Zsh with add-ons was noticeably slow compared to fish and syncing the config to all the devices I used.

ulzeraj · 9 days ago

ZSH plus oh-my-zsh cd’ing into a git repo with large LFS files will hang your shell even on very fast NVME storage.

adrusi · 9 days ago

You can get reasonable version control integration from zsh without any kind of wild oh-my-zsh config. Most distributed versions of zsh are compiled with vcs_info enabled.

    autoload -Uz vcs_info
    zstyle ':vcs_info:*' enable git hg
    zstyle ':vcs_info:*' check-for-changes true
    zstyle ':vcs_info:git*' formats "%{$fg[cyan]%}(%{$fg[green]%}%s %{$fg[blue]%}%r%{$fg[cyan]%}:%{$fg[green]%}%b%{$fg[yellow]%}%m%u%c%{$fg[cyan]%})%{$reset_color%} "

    setopt prompt_subst
    export PROMPT="%{$fg_bold[red]%}%n%{$reset_color$fg[white]%}@%{$fg_bold[green]%}%m%{$reset_color$fg[white]%}:%{$fg[cyan]%}%1~ \${vcs_info_msg_0_}%{$fg_bold[white]%}%(#.#.\$) %{$reset_color%}"

ivank · 9 days ago

I found that all I really wanted to show was the current branch, which I do with https://gist.github.com/ivan/79de5e87210e8cf21e305bb4c30c436...

xondono · 9 days ago

That’s the git plugin doing it’s thing. You can fix it in config but I admit is an annoying default.

wirthjason · 9 days ago

Any suggestions?

I’ve recent switched from vanilla bash to ZSH. I mainly use oh-my-zsh and Power10k. Once again the defaults without much customization.

animal_spirits · 9 days ago

My only plugins are zsh-autosuggestion (https://github.com/zsh-users/zsh-autosuggestions) zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting) and zsh fzf-tab (https://github.com/Aloxaf/fzf-tab) its been wonderful using these plugins

anamexis · 9 days ago

I prefer prezto to oh-my-zsh for performance reasons.

https://github.com/sorin-ionescu/prezto

Bayart · 9 days ago

Slimzsh[1] is a very nice default configuration. Just a slim prompt, fast-syntax-highlighting and some vanilla settings.

I keep a personal fork with a few added plugins (most notably zsh-autosuggestions and ssh-agent). No need for a plugin manager.

oh-my-zsh is way too bloated. But it's a nice repo if you're looking for plugins and aliases.

[1]: https://github.com/changs/slimzsh

mattgreenrocks · 9 days ago

The popularity of OMZ with the performance issues and update nags really makes me wonder if people even notice or care about those two things.

disk0 · 9 days ago

zinit did wonders for my config, would highly recommend:

https://github.com/zdharma-continuum/zinit

DeadAndHorny · 9 days ago

Better to use zgenom, it supports almost every plugins and faster.

GhettoComputers · 9 days ago

I just start scripts in bash for compatibility at the beginning or use scripts that state it, avoid scripting as much as possible, and I spent a lot of wasted time with configuration of zsh to get most of the functionality of fish but never as good. What did you install?

jscheel · 9 days ago

This is my problem as well. I’ve been using fish for quite a long time, and I’m still frustrated by weird posix incompatibility.

dangus · 9 days ago

bass can be helpful for some of those posix issues:

https://github.com/edc/bass

Another random tip: python virtualenv generates a activate.fish script that you should use instead of the plain activate script.

emptysongglass · 9 days ago

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.

lovelyviking · 9 days ago

>I’m still frustrated by weird posix incompatibility.

Can you also share what are the most significant problems with posix incompatibility for you? Why is it a problem?

mey · 9 days ago

The one I see is really, all of Linux vs OSX/MacOS. And which version of Bash is shipped by default.

Internally we have a boot strap run book developers/operations to bring up either Windows/WSL or MacOS to a consistent shell env.

jscheel · 6 days ago

Honestly, I think it’s just fighting years of muscle-memory more than anything. Not necessarily a valid complaint, I know.

progforlyfe · 9 days ago

Sadly this is the exact reason I switched away from it. I couldn't copy/paste in commands from coworkers or use common web projects (I'd have to either search for a fish replacement or convert it myself... Or just launch bash/zsh).

Really nice shell though, I hope it gets more traction.

ribit · 10 days ago

I really love fish and the philosophy behind it, especially the "configurability is the root of all evil" attitude. Makes for a well though out software that is a true pleasure to use.

ziml77 · 9 days ago

I love that philosophy too. If there's too many knobs to turn I'm going to constantly fiddle with them. The only things in my config.fish are calls to scripts to setup iTerm 2 integration and the Starship prompt.

thibran · 9 days ago

Most of it is nice, but declaring global variables with 'set -gx FOO 123" sucks. Same for "abbr --add g git", why can't it be just "abbr g git" or "set-global FOO 123"?

spoils19 · 8 days ago

Exactly. I know a lot of people will disagree but my advice to more junior guys is always get rid of the toys and learn the tools.

vasergen · 9 days ago

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.

jaredklewis · 9 days ago

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.

tomxor · 9 days ago

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.

Hamuko · 9 days ago

Just add #!/usr/bin/env bash?

canjobear · 9 days ago

Just invoke your scripts with sh or bash

stevage · 9 days ago

I basically always do that anyway. I never get around to working them executable so I just do

bash foo.sh

Which is actually easier to type than

./foo.sh

aembleton · 9 days ago

Especially as you can probably just type 'foo' followed by up arrow

j4hdufd8 · 9 days ago

Agreed. Wish there was a pretty shell like fish that used /bin/sh under the hood.

iamevn · 10 days ago

I've found fish to be absolutely wonderful for shell scripting. I can throw together a loop or a function with the sort of confidence I never could have in bash.

pxc · 8 days ago

Scripting in Fish is great in that even when you're still pretty new to Fish, you almost never have to think much about syntax or worry about quoting/word splitting behavior. It feels a little LISP-y, in a good way.

thrwyoilarticle · 9 days ago

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?

pxc · 9 days ago

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 serious. Some day I'd like to use something like Elvish or Nushell for both, and use the same language as my interactive shell.

MaulingMonkey · 9 days ago

> Ideally you do want them to be the same, so that the skill of using one reinforces the skill of using the other,

I've used several dozen shells, script languages, and programming languages - and have needed to do within the context of a single job. What's one more? For an interactive shell I prioritize writeability, and for scripts I prioritize readability and maintainability. These are often at odds - not just in what I write, but in the syntax itself - and by making my shell and script the same, I make middling compromises resulting in a jack of all trades that is a master of none.

I disagree that this is "ideal".

> and you can begin to shape scripts out of your shell history.

It's been my experience that this is quite doable even when the scripting language has different syntax than your shell. Oh, sure, it's not as simple as Copy+Paste - but it's never that simple. Even simple shell scripts inevitably end up needing error checking, sanity checks, error messages, ...

buu700 · 9 days ago

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.

yourad_io · 9 days ago

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!

kaba0 · 9 days ago

Bash scripting and convenient is strange in the same sentence. Bash is an abomination that should not even exist. Like, even thinking about a line of bash code will have 3 bugs.

aembleton · 9 days ago

Have you just tried the following to run your bash one liners in fish?

  bash -c 'echo "hello"'
Replacing echo "hello" with your script.

emersion · 9 days ago

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

CGamesPlay · 9 days ago

Actually, in the last few years this gripe has gone away, at least for me. Once they added proper support for `VAR=val cmd && othercmd`, I haven't run across any one-liners that didn't work in fish.

shepherdjerred · 9 days ago

I’ll trade the occasional minor annoyance for the day-to-day ease of use that fish provides

joshmanders · 9 days ago

The only issue I ran into this was when the one liners had subshell syntax $(cmd here), and all I had to do was convert $() to just ().

mattgreenrocks · 9 days ago

AFAIK that will be remedied in an upcoming release.

KptMarchewa · 9 days ago

bash -c "PASTE_HERE"

adrusi · 9 days ago

That's annoying when you have complex quoting in the pasted script, but you can always do

    bash
    PASTE_HERE
    exit
Works for everything unless the pasted commands set variables you want to use.

alerighi · 9 days ago

Because for you these are two distinct phases. But how many times you use a for loop for launching the same command multiple times? How many time you pass the output of the command as a parameter to another with $(command)? Or you use variable to save things?

Beside very basic usage, a shell is really a REPL for a scripting language. You can type commands but also you can do most advanced things (and that is what makes shell powerful). For example I maybe have to convert all the video files in a directory, and then upload them to a server, I can easily do that with a for loop in the shell, without creating a script.

And since you use both the shell to type commands and to write effectively scripts as in a REPL, that means that you have to learn another completely different programming language, the fish language (of course I assume that you already know POSIX scripting), and not only that, it's probably the case that only on your computer you have fish but it's not installed on every other system, so when you are using another computer (a server, a computer of a coworker that you are helping, etc) you will make mistakes because you confuse the fish syntax with the one of POSIX shell.

Yes, it's true that bash extends POSIX, and zsh too and it's not even compatible 100% with bash, but the differences are in things that it's rare that you will use in a basic script, and all these shells can understand POSIX syntax. A for loop it's the same in sh, bash and zsh (there is a shorter syntax in zsh, but the base one is the same), while it's completely different in fish.

smoldesu · 9 days ago

Yeah, I hear a lot of people throw shade at fish and then act equally surprised when I don't run my scripts with it. Much like Bash, Perl, Python or even ZSH by some respects, fish is just another tool in my toolbox. It so happens to be the one I default to though, which for some reason sends people flying off the handle.

ChrisSD · 9 days ago

Eh. Tbh I'm find both powershell and unixy shells have their advantages and warts. I'm not sure either is "better". Maybe I'm just not a fan of shells in general.

sandreas · 9 days ago

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.

nvllsvm · 9 days ago

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

assbuttbuttass · 10 days ago

Fish really shines in interactive use, like being able to write fish_vi_key_bindings, and that setting is preserved after restarting fish. Or using funced and funcsave to modify helper scripts, or abbr -s ...

I'm not sure I've ever opened my fish config file, but I'm still able to customize it easily

kbd · 10 days ago

As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know Zsh has a short for loop? Along with fantastic plugins like fzf-tab, I don’t see a reason to use anything else right now.

Though, I’m keeping a very interested eye on Nu shell. They’re doing a lot of stuff right, and I expect it will become a very useful scripting language in its own right even when not used full-time as a shell.

legutierr · 10 days ago

A recent demo of Nushell given a couple of weeks ago:

https://media.handmade-seattle.com/nushell/

ghostly_s · 9 days ago

Oh wow...finally someone is bringing the great ideas of Powershell to unix. Can't wait to see how this turns out.

michaelcampbell · 9 days ago

> great ideas of Powershell to unix

Now-If-They-Could-Improve the Syntax To-Make-It-Usable.

pxc · 9 days ago

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

user-the-name · 10 days ago

zsh has this absolutely ridiculous case of feature shyness. It has tons of great features, which it goes to great lengths to hide from you for some indecipherable reason.

opk · 9 days ago

The reason is to preserve compatibility for everyone's configuration that they carefully built up over decades. It's quite hard to change things to enable some new thing without annoying many users. The last time that was tried was in the '90s and there are still zsh developers around who experienced the fallout. I value the fact that my shell doesn't change on me without warning like many GUI desktop environments.

In recent years the existence of frameworks like oh-my-zsh has contributed further to this situation because it has separated the detailed configuration from the base zsh project. It's a pity omz doesn't enable more really. Many things it does are not really useful unless you take the time to actually learn them. A lot of plugins just define aliases but if you don't know what they are, they just sit there unused.

user-the-name · 9 days ago

Well, yeah, this is the problem. Throw new users under the bus in favour of old users.

sprash · 10 days ago

Many of the features are also achievable with pure bash with ble.sh (https://github.com/akinomyoga/ble.sh).

pxc · 8 days ago

Ble.sh seems pretty cool. The path hacking it does on readlink doesn't work right and causes the CNF handler to launch on NixOS.

I guess it does the PATH hacking based on whether the system is GNU or not so that it can get `realpath`/`readlink -f`-like behavior even on systems that don't natively have that because they include *BSD coreutils.

That might not behave as expected (and is unnecessary) on my macOS systems, either, since I like to keep GNU coreutils (with no `g` prefixes on the executable names) on my PATH there (heresy, I know).

It's also noticeably slower, to the point that there's a bit of jitter as I type.

It's pretty cool, though. If it's any better after I patch the readlink PATH hacking out, maybe I'll configure it for bash on my systems.

gogoyubari · 9 days ago

I find it amusing when people are discussing all these new shells and features, yet everytime I see someone letting them know they can do these exact same things in bash, there's absolute silence. It's not the first time I see ble.sh being recommended here with no reactions from the community whatsoever. As for fish, I've used it for a few weeks. Not having POSIX compatibility and GNU readline shortcuts made work much, much harder.

pxc · 8 days ago

> Not having [...] GNU readline shortcuts made work much, much harder.

That's weird. Fish has all of the GNU readline shortcuts OOTB and has for as long as I can remember

nerdponx · 10 days ago

Zsh has become an indispensable power tool for me. I am interested in other shells (especially PowerShell), but Zsh is now embedded deep in my brain, next to Vim and Python, and I doubt I will ever seriously migrate away.

That said: what do you like about Nu shell specifically?

kbd · 9 days ago

> 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 than figuring out how to `awk` your way through whatever text output a command generates, command output in Nu is structured and everything can be handled in orthogonal ways.

3. modern conveniences built-in, like syntax highlighting, and AFAIK they want to include features like "do something when you cd into a directory" that we currently need more tools for (i.e. direnv, which I highly recommend!)

4. serious technology. The people behind it are experts and JT has been showing off (https://youtu.be/3o8b_QcrFHc) the engine that enables trivially parallelizable loops. No more need for `xargs`.

5. I hesitate to mention "made in Rust" as a feature, but using a modern language for core infrastructure does matter.

kbd · 9 days ago

I'll put it this way: Nu shell seems perfectly supportive of my philosophy that a shell is basically a REPL for a computer, and they're taking the ergonomics of an interactive REPL along with the programming language that powers that REPL seriously.

The thing is, there's currently NOTHING GOOD for "shell scripting". Shell sucks (yes it does), so for anything more than very short things I'd rather write Python. But Python sucks for shell-like things, parallelization, it has slow startup, and you also can't do things like put environment variables into your session or change the working directory, so you often wind up writing shims (eg. Broot's br alias - https://dystroy.org/broot/install-br/).

Yes I've looked at Xonsh but maybe the additional syntax is offputting to me. Like, I wouldn't use it as a shell over Zsh (how's Xonsh's fzf support? I don't know, but I know everything's going to support Zsh), and I dunno if I want to use its syntax extensions over just Python. Though It's always on my list of things to re-explore, and maybe it'll click one day. But it being based in Python makes it feel slow (I wrote my prompt in Zig to get it to be fast...)

This is relevant to mention: I wrote a small Python library (https://github.com/kbd/aush) that's basically a DSL for subprocesses, so it tries to make it more convenient to do shell-like things. I find it preferable to shell or Python alone most of the time. Here's an example of its use in my script that creates a new Python project: https://github.com/kbd/setup/blob/master/HOME/bin/create-pyt...

I haven't figured out a convenient way to implement shell piping well with Python's pipe operator, or pass through interactive output directly (so things that "update" the display, like poetry and npm don't behave the same as they do interactively) so it's still .9 status, but it works really well for what it is, and you can always write "regular Python" along with it.

Anyway, Nu seems to be an attempt to put a "real" programming language REPL in my shell, from people who have serious language experience, so I'm hopeful it'll be great.

enriquto · 9 days ago

> 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 over-engineering. Plain tabular data is a perfect, and the columns of a table are always named 1, 2, 3. The whole point of abstraction is that you do not care about the meaning of the columns of your table, and the programs (like the lovely awk) that deal with these columns do not care either. There's nothing more "orthogonal" than that: filters that do not understand the data but can filter it anyway.

3. syntax highlighting is a very personal issue; in my case I prefer my terminal not to look like a christmas tree.

4. xargs is one of my favorite tools (alongside gnu make and gnu parallel) and there's nothing "unserious" about it. The happiest moments in my programming life are when I get to use these tools. Not using xargs sounds like a nightmare!

5. Rust is definitely an anti-feature to me: it's like a language that was built by picking the worst features of many already ugly languages. I would not really care in what language the shell is written, but I'd rather have it written in saner, "unsafe" languages.

GrinningFool · 9 days ago

Thanks for that, fzf-tab was the last missing piece in my setup.

kbd · 9 days ago

Nice. Yeah it works great. I have an extensive set of git aliases. Yesterday I was merging a branch with `gmn` (`git merge --no-ff`, which is actually an alias to `g mn`, where `g` is an alias to git of course) and it gave me a fuzzy find of my branches through all the aliases.

Edit: also things like `kill`. `kill [tab]` gives you a fuzzy-find list of all your processes so it's way faster to use than ps | grep.

rainingmonkey · 10 days ago

> while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins.

The point of fish is that there is no configuration required.

You don't have to learn to configure it, you don't have to be part of "the community" to learn which plugins to use, you'll be able to sit in front of any fish prompt and have it work as expected without having to move dotfiles around.

kbd · 9 days ago

That's a cool argument for Fish for beginners. When you spend thousands of hours in a shell that doesn't matter as much. I don't see any benefit for someone who has Zsh set up well, but yes you do have to google once how to configure auto-completion and so on.

ViViDboarder · 9 days ago

Probably little for anyone who has any shell “set up well”. Just if they are tired of spending time tweaking things and would rather more capable out of the box experiences so they can benefit from features added to the core shell without hunting for plugins.

I use Fish, however I also use Vim and do the plugin hunt there. I enjoy it, but I’m glad to not be doing it for both my environments.

bscphil · 9 days ago

> The point of fish is that there is no configuration required.

I think it would be more accurate to say that the point of fish is that there is no configuration allowed. If you don't like the out of the box configuration, I would say configuration is still required, but it's unfortunately not available. If you happen to like every single decision the developers made, then I admit having no configuration does mean you end up with a simpler, faster, more maintainable shell.

preseinger · 9 days ago

> If you don't like the out of the box configuration,

Then either decide to like it -- humans are adaptable, this is possible -- or don't use the thing. Both outcomes are acceptable. A hammer doesn't need to have a configurable grip and head and claw in order to be a good tool.

pxc · 8 days ago

Fish isn't that extreme. There's a fair bit of configuration allowed. The devs are just judicious about adding toggles.

You can configure scripting to run at various times, and there are even plugin frameworks for Fish. It just doesn't have toggles for things like language features in the way that ZSH does.

esyir · 9 days ago

I think this really shows the two schools of thought, and this is reflected in the attitude towards linux too.

A: Linux is amazing, I can configure everything the exact way I want.

B: Linux sucks, I need to mess around with configurations for hours before I get something usable.

A lot of us just want something that works out of the box with amazing defaults. Others want something that can be tuned to their exact preferences. However, configurability comes with it's own costs too.

desireco42 · 9 days ago

It is typical HN that everyone is talking about Zsh and how it isn't so bad. And you know what, I used it for a while long time ago, and it is great. I even had config I could transport to another machine when I need.

All that can't be compared with fish out of the box, which is why I am using fish, it will be 10 or so years now. When I say use, I mean that, I just use it, I don't spend time learning it's obscure features, creating scripts etc, no, just use it.

I have alias list that I use to make myself productive and it goes along with me to a new machine. Very slim and simple configuration. That and Vim, but that is another story.

vorticalbox · 9 days ago

where does one put an alias ?

i have a collection of them in my .zshrc that i would love to use.

iamevn · 9 days ago

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 because it's expanded before that.

tryptophan · 9 days ago

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

fouronnes3 · 9 days ago

I started a new job recently, and I've been thinking about terminals and shells. I love a well configured modern env, but I can't be bothered spending the literal HOURS you need to setup everything... zsh, zsh plugins, fzf, fzf plugins, fd, dot bare, patched fonts, 24 bit terminal color, temrinal color theme, binutils color theme, powerline, diff-so-fancy... I get that the devil is in the details, but come on, can I just have a single "terminal environnement distribution" with sensible defaults and that's it. Something like SpaceMacs/SpaceVim but for all that. I don't want to spend the time configuring and maintaining this wonderful pile of obsolete-and-yet-somehow-still-the-best-we-got technology.

the_duke · 9 days ago

That's exactly why I use fish.

The default setup is pretty much perfect for what I want. My only additions are fzf for history search, a bunch of aliases and Starship for informative status lines.

jkelleyrtp · 9 days ago

I use Powerlevel10k + ohmyzsh + Fira code + and the first google entry to "make zsh like fish". Usually takes me about 10 minutes to get set up in a new environment.

https://gist.github.com/abhigenie92/a907cdf8a474aa6b569ebe89...

mongol · 9 days ago

I agree with you here. I am like a terminal nomad, I have of course my own computer but there are so many other computers I log in to over the course of my career. They usually have bash and I have learned to just like that. I don't want to maintain one habit for my pet computer, and another when I am a nomad.

colelyman · 9 days ago

Have you tried https://ohmyz.sh/ ? It is the closest thing to SpaceMacs/SpaceVim for ZSH that I know of.

anamexis · 9 days ago

If oh my zsh is Spacemacs, then prezto is Doom Emacs: https://github.com/sorin-ionescu/prezto

pm90 · 9 days ago

This is why most people have a dotfiles repo in their GitHub.

BugsJustFindMe · 9 days ago

> most people have a dotfiles repo

Most people do not have a dotfiles repo.

Aloha · 9 days ago

Most people do not even have a github.

Barrin92 · 9 days ago

it's not such a trivial thing even if you manage dotfiles because a lot of things still break between different environments, different operating systems, don't work with new releases, rely on some folder structure that changes, etc, it still requires fiddling.

Of course you can get even more involved and manage your dotfiles with ansible or something but the advantage of a tool like fish is that it's almost perfectly usable out of the box. More config files will always increase the chance for things breaking.

stevage · 9 days ago

Or in my case, my Dropbox.

peakaboo · 9 days ago

Just synk your dot files with your config and a readme for what you need to install. Getting my shell up on a new computer is very fast because of this approach.

ilaksh · 9 days ago

I stopped using patched fonts because of that. And I never felt like 24 bit terminal colors was necessary. You can just install fish and then the fisher plugin manager and then install a theme/prompt plugin.

stardenburden · 10 days ago

> my grandma was afraid of Linux, until I showed her that fish can autocomplete

Unknown user on discord

rgoulter · 10 days ago

Not restricted to fish shell, but I can further recommend starship.rs as a prompt, and using fzf to search through command history.

pletnes · 10 days ago

Fzf can search virtually anything, since you can pipe output into/through it. It’s fantastic.