I just found out about fish shell a few moments ago. I switched Konsole on KDE to use it instead of bash and am impressed so far. Might install it on the Pihole eventually. Good stuff, just wanted to share. :)

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    27
    arrow-down
    1
    ·
    edit-2
    2 days ago

    Fish is great. I love how it works by default. I always felt like zsh required too much setup.

    Have you also tried nushell? It’s great for manipulating data from e.g. .csv or .json files. It works with structured data like so:

    • LucidNightmare@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 hours ago

      I’m honestly just now finding out about all of these different shells, and prompts! It’s amazing, and daunting at the same time!

      Right now, I’m just using fish since it does the little that I need from the terminal. I am a Linux noob/casual, so working with scripts or CSV or JSON files aren’t all that important to me. I will take a look at nushell though! :)

    • Oinks@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      2 days ago

      One thing that bothers me about Nushell (even if it doesn’t really matter) is honestly just how bloated the table style is, with three columns in each column margin and six columns of enforced line numbers. Why can’t it display tables in the same style as regular UNIX commands?

      Another thing that bothered me is that the “blessed” way to parse tables from external commands seems very fragile to me. Iirc the builtin parsing commands work solely off table headers, which are locale dependent for many commands, so a script might appear to work fine but suddenly break if an LC_* environment variable sneaks in somewhere. The size filter trick works nicely for ls, but doing the same thing becomes painful again when using df.

      I also found the script syntax (implicit line continuations, command seperation, etc.) difficult to understand but presumably that’s just a matter of familiarity.

      I’ll have to give it another try in the future but for now Fish is good enough for me.

    • Victor@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      2 days ago

      Not OP but I fell instantly in love with fish shell and its design principles.

      I’ve also tried nushell and its design and ideas are really cool. I’m sure it can be very useful for often handling data in the shell. But as a daily thing it was a bit much for me at the time to transition to. 😅 I’d love to explore more sometime though.

      • qaz@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        Yes, it takes some getting used to. I still use fish as my default shell and use nu for working with data.

    • The_Decryptor@aussie.zone
      link
      fedilink
      English
      arrow-up
      10
      ·
      2 days ago

      Yep, leave the default shell as-is and either set the terminal app to spawn the one you want, or exec fish from the existing shell profile in interactive cases.

    • tyler@programming.dev
      link
      fedilink
      English
      arrow-up
      25
      ·
      edit-2
      2 days ago

      To get most of the good features of fish in zsh you have to install a bunch of plugins. And it’s way slower than fish as well. I used zsh for like 6 years and when I switched to fish (probably in 2018 or 19) I’ve never gone back. Fish is just so much better.

      • rozodru@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        16 hours ago

        since I switched to NixOS I’m finding this out now. Prior to this every Distro I was on I used zsh/oh my zsh because I’m a dummy and need the autosuggestions, autocomplete, syntax highlighting etc and it was quick, no issues.

        Now that i’m on Nix zsh is slow to get to a prompt. logging in via tty takes 2-5 seconds to hit a prompt, in a terminal about the same. maybe I set up my nix config wrong, I don’t know. I’m only loading those three pluggins and I’ve boiled it down to the autosuggestions and or autocomplete.

        It might just be a conflict with NixOS’ auto suggestsions/complete thing (likely is) but if Fish or Nushell has the same 3 features I need because, again, i’m a dummy then I’d happily switch.

      • qaz@lemmy.world
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        1
        ·
        2 days ago

        And it’s way slower than zsh as well.

        Did you intend to write this part like this?

        • tyler@programming.dev
          link
          fedilink
          English
          arrow-up
          8
          ·
          edit-2
          2 days ago

          No I’m really tired and I think I backspaced and fished it up. OK I’m leaving that autocorrect cause it’s funny

          Edit: updated and fixed to say “it’s way slower than fish”

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          5
          ·
          2 days ago

          I have no idea where you guys are seeing any slowness for any shell, but perhaps worth pointing out that fish was recently rewritten (published as version 4.0), so if you are interested in it, might be worth another look.

          • Ghoelian@piefed.social
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 day ago

            My zsh is pretty slow sometimes, but that’s because I’ve enabled all kinds of git stuff in my prompt. I wish it could do those git commands asynchronously.

            • Ephera@lemmy.ml
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 day ago

              Ah right, the prompt would probably make a difference.

              I use Starship which probably does the Git commands asynchronously. The code at least mentions multiple threads and the Git stuff is split into multiple modules, which I would assume to be fetched in parallel.
              Either way, I have all the Git modules enabled and the prompt still display as quickly as my finger releases the Enter key, so definitely good enough for me. 🙂

              • Ghoelian@piefed.social
                link
                fedilink
                English
                arrow-up
                2
                ·
                23 hours ago

                Good point, I never even considered looking for a different prompt. Starship looks interesting, trying that today!

          • krimson@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 days ago

            Yeah could well be, it was some time ago I tried it. I am happy with zsh though, and as always, use what you like.

        • tyler@programming.dev
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 days ago

          How many plugins do you have? To get the same features that fish has I was seeing multi second loading times with zsh with every plugin system I tried.

        • Victor@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 days ago

          I had the opposite from you, zsh slow even with a couple plugins (or no plugins). Like, I could see a delay with my naked eye between opening the terminal emulator and the prompt appearing. Not with bash or fish though. 👌

    • Victor@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 days ago

      “zimfw”

      Look at what they need to mimic even a fraction of [fish’s] power ☝️

      • CubitOom@infosec.pub
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 days ago

        Idk, it could be argued that the ability to add exactly what features you want via plugins might make the shell more minimal and faster. Although most people don’t know what they want and just install everything.

        • Victor@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 day ago

          I’d rather have the official shell code add the features I want rather than have to maintain a list of the plugins written by god knows who, that add the functionality I want. Just my own gut feeling, you could call it.

      • pressanykeynow@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 day ago

        I use fish on a couple of devices, but damn it’s frustrating when you want to do a fast and simple bash scripting and it doesn’t work. Frankly now I think it would have been better to spend some time to setup zsh.

        • Victor@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 day ago

          but damn it’s frustrating when you want to do a fast and simple bash scripting

          Of course it’s going to be frustrating to try to write bash scripts and then try to run them as fish scripts.

          What you should be doing is writing fish scripts and running them as fish scripts. That is a much more pleasant experience. 🙃

          • pressanykeynow@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            1 day ago

            I know. I just don’t want to. There’s no point in learning fish scripting, you won’t use them anywhere unless you want your colleagues to hate you because now they also have to learn it for no reason.

            • Victor@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              20 hours ago

              I only use my scripts privately and my scripts are now shorter and easier to read and maintain. Also I use it as my everyday shell, and I couldn’t be happier with a shell right now, that I know of. The documentation is also extremely good. Simple to understand, and a small language.

              There’s a big point to learning it if you like its design principles. But if you don’t, then there isn’t. 👍

              Enjoy whatever shell you like!

        • foobaz@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          1 day ago

          I still write all my scripts for bash (or busybox sh) with a shebang, then call it from fish.

          • pressanykeynow@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            1 day ago

            I do too but then you want to just run basic for i;do x;done and you need to translate it to fish syntax.

            It wasn’t much of a problem but this thread actually convinced me that there’s less profit from fish than using something like an old oh-my-zsh(probably much easier to setup now).

            Is it good if you setup your new pc, don’t have your configs at hand and want a nice terminal with convenient features? Definitely. But I think it’s better to spend 5 minutes afterwards to move away from it.

        • Victor@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 days ago

          I’m not trying to change your opinion, just curious: what is the reason for wanting POSIX compliance? You often share scripts? Dotfiles perhaps?

          • Tangent5280@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 day ago

            I am shitty at shell scripting, so I often use other people’s scripts from the internet with some minor tweaks. I’ve also put a lot of time into learning the nuances of zsh so there is also a lot of the sunk cost effect going on.

            Also, and this is an assumption, I think other shells just have a lot more online resources you know? I have not yet found any problems or ideas I’ve had that someone else haven’t also had and solved.

          • WhatsHerBucket@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 day ago

            Fish isn’t posix compliant, so some scripts I use had issues. I’ll play devil’s advocate, why do you like fish? :)

            • 0xD@infosec.pub
              link
              fedilink
              English
              arrow-up
              3
              ·
              18 hours ago

              I like fish because it requires no setup to be nice to use and the scripting is more intuitive when not doing it constantly.

            • Victor@lemmy.world
              link
              fedilink
              English
              arrow-up
              6
              ·
              1 day ago

              so some scripts I use had issues

              I just rewrote all of my scripts in idiomatic fish. 😄

              why do you like fish? :)

              It made my scripts 50% shorter on average, and 100% more legible. Short and simple. The code is easier to read and maintain, IMO. Less magic syntax that you need to look up in the bash manual* every dang time. You come back to your scripts after a few years and you just instantly can see what they do, without comments.

              (*) Speaking of the manual. The bash manual is quite long. And the zsh manual is a f—ing mess, split up into so many sections, and the thing I want to find is never where I first look, so I just go into the zsh “all” manual, which is humongous and difficult to navigate, basically just a cat of all the different zsh manuals.

              Fish has a short and sweet manual because the language is very small, and every command has its own manual page as well, which just makes sense on some level. Also it’s available as a web page by typing help. Very convenient.

              Very well thought out. 👌

  • Alphane Moon@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    2 days ago

    How does it compare to bash?

    I am a relatively casual Linux user (headless Pi-hole and grandma used to use Ubuntu for basic use cases) and have only ever used Bash, that too for relatively simple tasks.

    • LucidNightmare@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      12 hours ago

      I do not use bash for anything other than running what a casual Linux user would be running. I like it for the autocomplete functions, and the TAB feature to give you my own reasons! That’s all I need in my setup, so it works way better than bash. :)

    • Botzo@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      ·
      2 days ago

      If you ever copy paste commands you don’t understand (and aren’t prepared to take a detour down a rabbit hole to figure out why they didn’t work), stick with bash (or zsh).

      Fish isn’t “posix compliant” which can make some things work (or not) unexpectedly.

      Don’t get me wrong, it’s a great shell and there are many reasons people emulate its behaviors in other shells, but I can’t recommend it as a “newbie” or “casual user” choice.

      • Alphane Moon@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        3
        ·
        2 days ago

        I most definitely copy and paste commands that I don’t understand. I even use LLMs to help write simple Bash scripts. :)

        I was just curious what the use cases are for this shell as I’ve only ever used Bash.

        • Botzo@lemmy.world
          link
          fedilink
          English
          arrow-up
          8
          ·
          edit-2
          2 days ago

          It’s a very user-friendly shell… except for the posix compliance.

          Everyone I know who (still) uses it daily accepts that they have to translate back and forth and still write scripts in bash (or sh).

          If you wanna give it a go, by all means. It’s just as easy to switch as to switch back. You can always drop into bash and try a command again too.

          • Victor@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 days ago

            I never have to write scripts in bash after having switched to fish. I just write all my scripts in fish. 🤷‍♂️

            • Ephera@lemmy.ml
              link
              fedilink
              English
              arrow-up
              5
              ·
              2 days ago

              It’s unfortunately not that easy when you’re using Linux at your job or want to be able to share your scripts with others…

              Like, Bash for scripting is quite cursed, but people will typically still prefer using it over learning a new language.

              • 123@programming.dev
                link
                fedilink
                English
                arrow-up
                1
                ·
                1 day ago

                Not to mention some environments don’t let you install anything other than what’s already on the box. Both sh and bash generally are available.

                • Ephera@lemmy.ml
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  23 hours ago

                  Ah, good point. In many cases, you also don’t want to install an alternative shell, like if you’re dealing with lots of containers and would need to make Fish available in each one.

                  Although, I will say that more recent versions of Fish are available as a standalone executable, so you don’t have to install it in the traditional sense. You can probably transfer it together with your script file in most cases. That’s a relatively new/experimental feature of Fish, though, so no idea how well such a workflow goes in practice.

              • Victor@lemmy.world
                link
                fedilink
                English
                arrow-up
                3
                ·
                2 days ago

                I use Linux for my job but luckily I don’t have to share scripts with anyone. 😌

    • tyler@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      2 days ago

      It’s vastly more user friendly than bash, though if you need to write a script and only know bash then you should drop back into bash.