• Fisch@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      94
      ·
      2 天前

      Currently using zsh but I installed fish yesterday to try it out because I’m thinking of switching. All the zsh plugins I have are basically just replicating what fish has by default anyway and fish might do it better.

    • flandish@lemmy.world
      link
      fedilink
      arrow-up
      26
      ·
      2 天前

      what’s fish got? I’m liking zsh here but am always open to a distraction instead of getting work done. :)

      • null@piefed.nullspace.lol
        link
        fedilink
        English
        arrow-up
        39
        ·
        2 天前

        Lovely OOTB defaults. I basically change nothing except the theme.

        Autocomplete, git context, etc. The QOL stuff you’d expect.

          • OhNoMoreLemmy@lemmy.ml
            link
            fedilink
            arrow-up
            32
            ·
            2 天前

            The main differentiator of fish over everything else is it prioritizes intuitive behavior over backwards compatibility.

            Zsh is to bash as c++ is to c. Most bash scripts and habits will work in zsh, but zsh is just more convenient and has more options. Fish is intentionally different.

            Do I wish fish had existed instead of bash so we had a nicer terminal experience? On the whole, yes. But I also couldn’t be bothered to learn another shell where most of the instructions online won’t be able to help you, and I ended up sticking with zsh.

          • Laser@feddit.org
            link
            fedilink
            arrow-up
            15
            arrow-down
            2
            ·
            2 天前

            Be aware that fish isn’t a POSIX-compatible shell enough, so you have to adjust syntax.

            • rtxn@lemmy.worldM
              link
              fedilink
              arrow-up
              22
              ·
              edit-2
              2 天前

              That isn’t incorrect, but it’s not as important as people make it out to be. Linux isn’t certified as POSIX-conformant either.

              People are way too stuck on POSIX regarding Fish specifically, but in shell scripting, POSIX compliance boils down to “can it run a pure sh script”. Bash is compliant. Zsh is partially compliant and needs to set an option to emulate sh. Fish uses a different syntax and is not compliant; if that is a problem, don’t execute sh scripts in Fish.

              POSIX compliance for shell scripts was important in the 80s and 90s when the #! directive wasn’t as commonly implemented and every script might be executed by the user’s $SHELL instead. That is no longer the case as virtually every Unix-like system’s program loader supports #!.

              • Black616Angel@discuss.tchncs.de
                link
                fedilink
                arrow-up
                4
                ·
                2 天前

                I use fish, but sometimes it acts weird. And lots of “just copy and past this command” kind of online solutions I have to put into bash.

                My main irk is when I want to forward a ‘*’ to a program but have to escape it.

              • Laser@feddit.org
                link
                fedilink
                arrow-up
                3
                ·
                edit-2
                2 天前

                It’s a cool shell, I use it as a daily driver (though I’m keeping a close eye on elvish which syntactically is even further away from classic shell), but the comments read like fish is basically zsh. And while zsh is pretty close to bash, fish isn’t.

          • Pika@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            5
            ·
            2 天前

            This is a good way of putting it. It’s essentially ZSH with Autosuggest/complete and a theming agent. At least visual-wise.

            When you get into the scripting and the hot keys aspect of it, they reinvent the wheel and everything is different., Like for example ,!! and other bangs(I think that’s the right word?) like that are not valid on fish, And everything to do with variables is different from adding to your path to setting variables to creating functions. Also checking your error code is going to be different as well as it doesn’t follow the $x style inputs and doesn’t support IFS and globbing works differently.

            TLDR; fish is nice, but If you use it unless you want to relearn an entire type of language, keep your scripts on bash or zsh

            or if you wanna see the bigger differences fish has a dedicated bash transition page

            • Digit@lemmy.wtf
              link
              fedilink
              English
              arrow-up
              1
              ·
              22 小时前

              I never managed to learn bash’s ways in my first decade of using it, learning fish a decade ago was easy by comparison. So much more human readable and sensible and consistent. Even though fish is the friendly interactive shell, I now use it for all my scripting too.

              • Pika@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                1
                ·
                19 小时前

                That was the exact opposite with fish. I had already gotten fairly well first with bash by the time I started using it, and the way fish did it was just super counterintuitive to me.

                I couldn’t get into the overall design of how it looked and I disliked how command substitution and the built in’s worked, Combined with the fact that it’s a lesser used shell, so there’s less information available on it. I just couldn’t do it.

                You brought up a point though. That makes me ask. You must not have to share your scripts with anyone then, right? Fish has a very small user base in comparison to ZSH and Bash and when I make a script that’s more advanced I tend to want to share it with my friends and having them install a whole new shell just to run a script is just not helpful to me. ZSH is close enough to bash in compatibility that, generally speaking, if I want to share it, I can use zsh And then convert the minor discrepancies. Where with fish I have to redo the entire script.

                • Digit@lemmy.wtf
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  9 小时前

                  I don’t know why small user base is considered as meaning I must not have to share my scripts. Is it like an argumentum populum thing? [“If you build it they will come.” ;D]

                  [I suppose It’s true in a strict interpretation of those words… I don’t have to.]

                  I think I have several on my git repos. [… I have even written a text editor in fish.]

                  Free to use for anyone who wants to.

                  Also, if user base size is a concern, Fish’s user base is growing faster than Bash or ZSH.

                  Installing another shell seems a trivial matter to run something.

                  I install far bigger languages for far less all the time.

                  And conversion [if for some edge case reason you really need to ~ I know not why though] is generally trivial these days… just ask an LLM, if conversion scripts are lacking.

                  As for the less information about it… the online help’s really rather thorough and accessible.

                  I don’t know that quantity over quality would help. It didn’t for me and bash.

                  Unless I missed something, it seems to me that all that remains, is

                  I disliked

                  And that’s of course utterly fine. Free software’s defining point zero, the freedom to use software, includes the freedom to not use. Good to have multiple options to further facilitate that first freedom, catering to more variety of tastes.

          • null@piefed.nullspace.lol
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 天前

            Yup, very similar! And quite customizable as well if you want to. But the focus is on having, by default, a friendly interactive shell.

            I like that I can spin up a VM, install fish, chsh and I’m all set.

    • prole@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      5
      ·
      2 天前

      Fish is great if you can’t remember a specific command, or don’t want to type out long filenames/locations, but I dunno if I’d use it as the default.

      I just type “fish” in the terminal if I ever run into a situation where I might get some use from it.

      • Digit@lemmy.wtf
        link
        fedilink
        English
        arrow-up
        2
        ·
        22 小时前

        in my ~/.bashrc

        # if interactive, launch fish
        [[ $- != *i* ]] && return || fish
        

        and

        alias f='fish'
        

        So fish is my default, and if I ever need bash, it’s already there underneath, just a Ctrl-d keybind away to fall back on, and if I want to get back into fish, it’s just a f & RETURN away.

        Seems better to have all the convenience of fish up front. All the completion magic. I so rarely have to type much at all.

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 天前

          I have that occasionally when I want to copy a complex bash command from somewhere. But yeah, I can then just run bash, run the command in there and then exit back out of there.

            • Ephera@lemmy.ml
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 天前

              I’m guessing, you mean this then: https://github.com/edc/bass

              But well, I was rather thinking of when it’s using Bash-scripting-syntax to combine multiple commands.
              Like, maybe there’s a for-loop in there. You just can’t paste that directly into Fish and have it work. Granted, you should probably put that into a script file, even if you’re using Bash, but yeah, just temporarily launching bash is also an option.

    • inzen@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 天前

      I jumped from bash to fish because cachy os has it as default. I kinda don’t like it, it’s a little too fancy, but it’s not bad enough for me to bother switching the default to bash. So I’m using it. Still not quite liking it but maybe it’s growing on me.