I’m moving my posts from Reddit to Lemmy before delete them.

This post is from 2020-09-03.

    • argv_minus_one@beehaw.org
      link
      fedilink
      English
      arrow-up
      6
      ·
      1 year ago

      Automatic cd: Zsh simplifies directory navigation by enabling users to change directories simply by typing the name of the desired directory. This feature eliminates the need to type the “cd” command explicitly, saving time and keystrokes.

      What if there happens to be a command with the same name?

      • Still
        link
        fedilink
        English
        arrow-up
        7
        ·
        1 year ago

        command goes first

        order is shell built in > path > autocd

        • argv_minus_one@beehaw.org
          link
          fedilink
          English
          arrow-up
          9
          ·
          1 year ago

          Then you’re likely to enter a command by accident. I would consider that a dangerous misfeature and look to turn it off.

          • Still
            link
            fedilink
            English
            arrow-up
            4
            ·
            1 year ago

            not really tab complete puts a / at the end of autocd directories

            • argv_minus_one@beehaw.org
              link
              fedilink
              English
              arrow-up
              4
              ·
              1 year ago

              Can you not type in the name of the hazardous folder yourself? I’m envisioning trying to autocd into a folder named reboot or something.

              • Still
                link
                fedilink
                English
                arrow-up
                1
                ·
                1 year ago

                then you would type reboot/

                  • Still
                    link
                    fedilink
                    English
                    arrow-up
                    2
                    ·
                    1 year ago

                    it does but if you had a file called reboot tab complete would complete the reboot command and not put the slash thwre, adding the slash specifies that it’s a directory

          • Gamma
            link
            fedilink
            English
            arrow-up
            3
            ·
            1 year ago

            I’ve got syntax highlighting enabked, so I always notice the different color when I type a commnand.

    • oktoberpaard@feddit.nl
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      Some of those options exist in Bash too, but need to be enabled in your profile: https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html. Bash is also more like to be available on random machines that you have access to. Lastly, if you’re working a lot with Bash scripts in your (work) environment you might feel more at home using Bash in interactive mode too.

      Those are just some counter arguments for the sake of completeness. I think zsh is great, even though I personally don’t use it (yet).

    • zzz@feddit.de
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      OK GPT, now give me 7 reasons why Bash is better than zsh, please!

      • Gamma
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        1 year ago

        Yeah, from the first line

        Zsh, an extended version of the Bourne Shell (sh)

        This screams AI-generated.

    • WIPocket@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Automatic cd isnt a zsh-only feature. You can use it in bash by shopt -s autocd. Afaik its also disabled by default in zsh, just enabled by oh-my-zsh.