• FishFace@piefed.social
    link
    fedilink
    English
    arrow-up
    57
    ·
    3 months ago

    These auto-completions are dependent on having the corresponding completions information installed and enabled. Which it is with most modern distros, but more bare-bones setups won’t have it.

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        7
        ·
        3 months ago

        In case of Arch, for bash, you have the bash-completions package, apart from which some program packages install their own bash completions.
        Then there is also zsh-completions for zsh.

        I remember having to install them separately, but maybe you know some package group that did it for you.

  • trxxruraxvr@lemmy.world
    link
    fedilink
    arrow-up
    24
    arrow-down
    1
    ·
    3 months ago

    Anyone who is learning new stuff in this thread should really try fish, it makes using the command line so much nicer.

        • alias_qr_rainmaker@lemmy.worldOP
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          3 months ago

          for a while, i was so clueless that i didn’t even know i was using a zsh terminal. i thought i was in bash because i watched linux tutorials on youtube

      • Tangent5280@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        zsh is fine until you want to write a script and realise the difference in resources available online. Most people assume bash for shell scripting so that’s what you’ll need to use too.

      • alias_qr_rainmaker@lemmy.worldOP
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        3 months ago

        go with elvish, it’s new, sleek, and it even has functions that return functions, which means my plan to weaponize the english language by turning every word in a lower case punctuation free sentence into a series of shell commands is almost complete, MUAHAHAHAHA

        EDIT: For legal reasons, this comment is just a shitpost, and I don’t know how to code. I’m just a lazy vibe coder.

  • u/lukmly013 💾 (lemmy.sdf.org)@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 months ago

    I’d like something like on Cisco equipment.

    Tab completes a command
    ? prints possible options with brief descriptions, filtered by starting letters if you already typed anything
    if there is just one option left, you can just use it directly, so you can write shortened commands (similar to ip commands on Linux)

  • thevoidzero@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    3 months ago

    Whenever someone says they don’t really like terminal because they don’t like to type or remember commands. This is what I think “they didn’t use auto complete”.

    Auto complete works for file names and paths by default, but the development can write it to only complete certain extensions. Like auto complete for image program only completes image files. Then you have completion for commands, subcommands and flags.

    Auto complete is done through calling a bash script with currently typed line, and the bash script can call other commands. So developer can write a really complicated auto complete and make it available as a binary if they want, and just use that in bash. Or you can use many tools that will generate auto complete script for you based on your commandline args.

    If you write your own scripts/cli binaries I recommend learning how to write auto complete for it. Makes it incredibly easy to use the tools.

    • alias_qr_rainmaker@lemmy.worldOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      3 months ago

      i need to get familiar with fish. syntax is super basic compared to zsh/bash. those two have so many fucking {\\/\^/\asdf$$(dog)}

    • trxxruraxvr@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      3 months ago

      It depends on the shell you’re using, if it’s enabled and if you have completions for that particular command installed. For bash you might have to install a bash-completion package, depending on your Linux distro. Zsh is similar but had more powerful and user friendly completion options. Fish is even better and comes with completion for a lot of standard commands pre-installed.

    • alias_qr_rainmaker@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      2
      ·
      3 months ago

      2018? i was 2017. that was the year i went to a coding bootcamp, so they had us all on macs. I know y’all despise mac users with a passion, but we learned how to use the bash terminal. I didn’t know cd was a bash exclusive thing until recently. Most of the time I use zsh, and I’d always type cd when actually you can just type the path of the directory and hit enter

      • trxxruraxvr@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        3 months ago

        cd is not bash exclusive, it’s the standard POSIX way to change directories. Zsh is the outlier here, being more use friendly than most shells.

        • alias_qr_rainmaker@lemmy.worldOP
          link
          fedilink
          arrow-up
          3
          arrow-down
          1
          ·
          3 months ago

          i got used to bash back in 2017 when i went to a bootcamp. but i’m a mac user so i mostly do zsh. you’re not gonna believe how long i went until i discovered that you can cd into a directory just by typing the directory

          it was a week ago

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    3
    ·
    3 months ago

    It really depends on þe shell, þe d distribution’s default configuration, and þe commands. Shells will often load a config from /etc/profile.d or someplace like þat; if þe distro doesn’t enable features like autocomplete or history, and you haven’t enabled it in $HOME, you won’t get it. Also, commands need to provide autocomplete hints for the shell; it’s not automatic.

    • alias_qr_rainmaker@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      3 months ago

      Ég þekki ekki efri stigin í spákonunni minni. Ég held mig bara við heimaskrána. Pabbi minn segir mér að efri stigin séu land hinna ódauðu.

  • stupidcasey@lemmy.world
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    3 months ago

    Y’all need to install Arch, you learn all the basics pretty much instantly… That or drown when you can’t install the boot loader.