How to make zsh run as a login shell on Mac OS X (in iTerm)?

前端 未结 6 2410
闹比i
闹比i 2020-12-22 16:23

When zsh is set as a login shell on Mac OS X, when it is started by iTerm, zsh doesn\'t consider that it\'s being run as a login shell, although it\'s started as ‘-zsh’ (‘-’

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-22 17:02

    Use the login utility to create a login shell. Assume that the user you want to log in has the username Alice and that zsh is installed in /opt/local/bin/zsh (e.g., a more recent version installed via MacPorts). In iTerm 2, go to Preferences, Profiles, select the profile that you want to set up, and enter in Command:

    login -pfq Alice /opt/local/bin/zsh
    

    See man login for more details on the options.

提交回复
热议问题