How to Enable Autocomplete in Mac Terminal

Usually in a Unix/Linux terminal when you press tab it will autocomplete with several options and then it will list the options below for you to select. This is a great feature if you spend a lot of time in the terminal. You could install ZSH to get these features or if you are like me and like to keep things simple, you can enable autocomplete in the mac terminal using bash.

Enable auto-complete in Mac Os terminal

  1. Type in terminal nano ~/.inputrc
  2. Paste the following on separate lines
  3. set completion-ignore-case on
    set show-all-if-ambiguous on
    TAB: menu-complete
  4. Hit control+O to save changes to .inputrc followed by control+X to exit nano
  5. Open a new Terminal window or tab to open a new session with autocomplete enabled
  6. Type and hit the tab key

Let me know if this is helpful in the comments below!


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

44 thoughts to “How to Enable Autocomplete in Mac Terminal”

  1. $ brew install zsh

    Was that even hard?

    Now if you’re really tired of seventies tech you should try fish.

  2. .inputrc is a bash thing, it has nothing to do with the Mac Terminal as the headline says.

    If you’re not using bash, this won’t help.
    If you are using bash and using iterm2 or some other terminal program or ssh’ing, it will.

    1. Good point but isn’t bash default for Mac OS? I’m assuming that if you are not using bash, you would know this Wil not work. Thanks for the feedback. I will update the post 👍

    2. It’s good Tim put Mac in the post as a novice like me search it as a mac terminal issue.
      Thanks a lot, Tim, My content is that such simple solutions make you a pro.

  3. I second the notion of using bash. I think the information here could be a good starting point for many macOS users.

  4. Hello, I am new to terminal and pretty green to coding in general. If for some reason I wanted to remove this setting after having installed it, is there an easier way than to reset my terminal and manually putting in my preferred settings from scratch?

    Thanks for your time

    1. Hey Ian,

      Yes you should be able to remove the lines and save the file. Once you open a new terminal it will be back to how it was before.

      1. haha thanks for the speedy response Tim! I guess as such a new guy… how to I access the lines that I just added and remove them?

  5. Hey Tim,

    Your instructions seem to be consistent with other posts. I have entered those three lines in the .input.rc file. However, autocomplete still doesn’t work. Any ideas?

    I’m just referring to the default terminal program in macOS.

    Thanks,
    Vernon

  6. Thanks for the article.

    And that is a big thanks from one who likes bash and even uses vi for the last 35 years .

Leave a Reply

Your email address will not be published. Required fields are marked *