"What's new in fish 4.0" has been merged into this story.
  1. 135
  1.  

    1. 49

      I gotta say, the dev team behind fish really seems to know how to dev. They:

      • pulled off a rewrite
      • care enough about their users to…
        • keep track of breaking changes and communicate them in great detail
        • understand when to break things vs deprecate them
      • value POSIX compatibility while at the same time not allowing POSIX to ruin their project

      etc.

      Of course we’ll see for sure how well it turns out after a few point releases, but so far at least, it seems like they deserve a standing ovation. I wonder how old they are, because it looks to me like they have a lot of hard-won experience and discernment.

      1. 45

        The qmark-noglob feature, introduced in fish 3.0, is enabled by default. That means ? will no longer act as a single-character glob.

        Hell yeah! This is gonna make pasting links into the shell so much easier ^^

        1. 30

          I think I’ve used ? as a shell metacharacter on purpose about twice in my entire life. I strongly agree that dropping it is nice.

          1. 3

            I wonder if it would work well to use paste bracketing for something like this. If you are pasting something that is mostly text but has a wildcard or two auto-escape it. I can also imagine similar features like if you type a quote, then paste, it will auto-escape any quotes in the pasted text.

            It would probably do what you want most of the time but would probably have false-positives commonly enough that it would be negative overall. But maybe there are specific cases that are clear enough to be handled (like pasting something that starts with “https:” or immediately after a single quote).

            1. 11

              I can also imagine similar features like if you type a quote, then paste, it will auto-escape any quotes in the pasted text.

              Fish 3.7.1 already does this.

              1. 2

                Kitty just asks you every time.

                But I think a control sequence which pastes raw would also work.

              2. 2

                Wouldn’t many URLs still contain the & character which would incorrectly break off the URL part-way and spawn background jobs that would almost certainly fail?

                1. 7

                  No, echo a&b works for me in fish, as does echo a&b://%20?q. I think fish might require a space before and/or after the & for it to create a background process.

                  In bash, echo a&b does not work.

              3. 13

                Great news! I’ve been running the 4.0b1 since it became available and honestly, you mostly can’t tell the difference while using it (benchmarks vary, but in terms of UX it’s about the same as ever), in a good way. You can absolutely tell the difference for installation (the self-installing binary) when it’s not in a repo, and the ctrl-r glob is notable.

                1. 4

                  I’m curious, how much has the binary size changed? In my experience, tools written in Rust such as rg are about 20× larger than their C counterparts.

                  1. 17

                    The static build of fish for linux-amd64 from the releases page is 14M. My local build of fish 3.7.0 is 1.7M, but it also includes /usr/share/fish which is 9.1M. Since the static build includes all of that data, the fair comparison is between the addition of those, which brings us to 14M vs 10.8M.

                    In summary: bigger, but only slightly (~25%).

                  2. 2

                    I think the default behavior for alt-backspace has changed to delete the full argument instead of the token. In ls a/b/c/d | hitting alt-bkspc used to go to /c and instead now it goes to ls

                    just to say I’m working on retraining my muscle memory to use ctrl-w

                    1. 4

                      I believe that change was reverted between the beta and the full release: https://github.com/fish-shell/fish-shell/issues/10926#issuecomment-2637700994

                  3. 9

                    This is the first release of Fish after the re-write into Rust. While it’s mostly very similar to the previous version of Fish, there are a few new features and a couple of breaking changes.

                      1. 3

                        Oh, somehow I missed that first one when I scanned /newest. @pushcx could you do a thread merge?

                      2. 8

                        Switched to fish a few months ago. It’s not like a revolutionary shift from bash, but it’s just all around nicer. Nicer autocomplete, nicer to configure, nicer config file. A step up all round.

                        1. 5

                          Homebrew updated it for me, and I never even noticed. That’s a good sign!

                          1. 4

                            I like the static binary and easy install. I wonder if they fixed an issue I found on Amazon Linux which causes extraneous characters in the prompt. Something about kitty terminal stuff aws hates.

                            1. 3

                              It’s not fixed/it wasn’t broken in fish as such, but you can disable what’s causing it via set -Ua fish_features no-keyboard-protocols as of fish 4.0

                            2. 4

                              Congrats to the Fish team on the rewrite! I am officially interested in Fish at the moment, so, Fish advocates, please sell me on it. I have a well-configured Zsh with the few plugins that matter and I think it’s fine. What can I gain from Fish?

                              1. 2

                                Speaking as a zsh switcher: you no longer need configuration to speak of; you get everything you want out of the box. I have some aliases defined but that’s about it. Plus nice things I wouldn’t have bothered to set up in zsh, like syntax highlighting and alt-arrow to switch directories. Plus some stuff that I think is unique to fish (?), like parsing man pages for completions instead of needing someone to write a script for you.

                                1. 2

                                  Is there any equivalent to fzf.zsh and, more importantly, fzf-tab?

                                  Just like GP, I’m now actively pondering jumping ship, just out of the “sane behavior by default” sentiment, but this kind of deep integration between completion and fuzzy matching is quite literally the bread and butter of my shell productivity.

                                  1. 2

                                    I don’t know everything those do, but take a look at:

                                    I have the second one set up on one machine but don’t have enough experience to make a recommendation.

                                    1. 2

                                      Yeah fzf-tab is killer in Zsh, wouldn’t want to switch to Fish unless I could have something similar.

                                    2. 1

                                      you no longer need configuration to speak of

                                      This is the worst reason to provide me. I’m wondering what benefits there are to switch to Fish given that my Zsh is already well-configured. It’s also untrue, as I use a lot of Zsh features like hashed directories, functions and aliases, and things like fzf-tab, and I’ll still need to configure all the things in Fish like direnv, atuin, my prompt, etc.

                                      I’ve looked into ways to share my bash/zsh aliases with Fish and I guess there’s bass?

                                      1. 2

                                        If your config is super-personalized then yeah, any switch is going to involve some config. For me, the defaults were 90% what I wanted and the rest was minor tweaks to simple stuff like prompt and aliases (hm, I wonder if Claude could rewrite your aliases for you).

                                        In that case I will just say the Fish language and its affordances for configuration are very nice. As a tiny example, if you want to set an environment variable persistently and globally, it’s just a switch, set -U. It even gets set instantly in all currently-running shells!

                                        1. 1

                                          Hehe we are different kinds of people. Out of everything I know about Fish that’s the part I dislike the most so far (needing to edit env vars through the cli). I source control everything, would much rather add an export to a config file.

                                          Best things so far seem to be 1. way better array handling, 2. more regular shell syntax in general. I’m a bit jealous of the better array handling and argument passing model but yeah it seems like a wash for now, no reason to switch from Zsh.

                                          1. 2

                                            It’s just editing the ~/.config/fish/fish_variables file for you, so it’s entirely visible to SCM. You can just edit it yourself if you want. Or you can do it the old-fashioned way with set commands in config.fish or conf.d/*. (Of course you don’t get the instant cross-shell setting that way, but that’s no worse than zsh.)

                                            1. 2

                                              Do not edit fish_variables, if you need to modify it, do it so via CLI or config.fish/conf.d with set command, otherwise you risk it being overwritten

                                              1. 1

                                                Oh, not a two-way thing, huh? OK, then I agree it seems like a problem if you want to do source control on your dot files.

                                  2. 3

                                    I was planning to make the move from zsh to nushell as a Rust-based shell because of its structured data capabilities, but fish might be a more mature option to try out something new. Does anyone know how the Rust rewrite of fish compares to nushell in terms of performance?

                                    1. 10

                                      Nushell was noticeably slower than fish last I used it (maybe 6+ months ago?), but unless Nushell got job control, I don’t consider them direct competitors. Nushell is something I keep checking to use in place of things like PowerShell for my use cases. fish is awesome just being my interactive shell.

                                      1. 1

                                        Ah I see :( I was mainly wondering if the performance benefits of not having to pass data as text between commands may outweigh the relative immaturity compared to fish

                                        1. 2

                                          It is the command-line tools that you use, not the shell, which impose passing text around. This has always been true. For example, you can build up database-like operations (with database-like performance or possibly even better with properly PGO SIMD compilation optimizations..) using streams where there is no parsing on a per input byte basis or formatting on a per output byte basis in a couple thousand lines of Nim.

                                          It can be helpful, of course, for very small data (where the time to fork & exec seem like large costs) to have things built in to the shell, and then the shell can matter. For such tiny data performance only really matters if there is an “outer loop” over a great many situations, though.

                                      2. 1

                                        Fast enough at what? I don’t remember using fish and being annoyed by anything being slow.

                                        1. 6

                                          To the contrary I’ve switched to fish on a few very low spec machines because it’s noticeably faster than other shells, even before the rust rewrite.

                                      3. 1

                                        Fish is just a joy to use! I still use bash for scripting for compatibility reasons, but as a shell it is unmatched.

                                        These articles by julia evans are a good introduction for beginners.

                                        Nushell is also a super interesting non-posix shell.

                                        1. 1

                                          Great. The new bind syntax is such a welcome relief!

                                          1. 1

                                            The fish dev team knows how to make tools for the programming community which is HARD to do