How to set my default shell on Mac?

前端 未结 16 974
抹茶落季
抹茶落季 2020-11-30 16:23

I do not like to retype fish every time I start terminal. I want fish on by default. How can I set fish shell as my default shell on a Mac?

16条回答
  •  臣服心动
    2020-11-30 17:12

    How to get the latest version of bash on modern macOS (tested on Mojave).

    brew install bash
    which bash | sudo tee -a /etc/shells
    chsh -s $(which bash)
    

    Then you are ready to get vim style tab completion which is only available on bash>=4 (current version in brew is 5.0.2

    # If there are multiple matches for completion, Tab should cycle through them
    bind 'TAB':menu-complete
    
    # Display a list of the matching files
    bind "set show-all-if-ambiguous on"
    
    # Perform partial completion on the first Tab press,
    # only start cycling full results on the second Tab press
    bind "set menu-complete-display-prefix on"
    

提交回复
热议问题