iTerm 2 profiles

前端 未结 7 1716
庸人自扰
庸人自扰 2021-01-29 23:10

I have recently switched over to iTerm2 and love it. I am wondering though if there is a way to use profiles to correspond to what environment/specific machine you are on.

7条回答
  •  一整个雨季
    2021-01-29 23:34

    step 1:

    custom your iterm profile, e.g. dark, light

    step 2:

    add code before to your shell profile, e.g .bashrc or .zshrc

    # Change iterm2 profile. Usage it2prof ProfileName (case sensitive)
    it2prof() { echo -e "\033]50;SetProfile=$1\a" }
    

    step 3:

    make sense your profile

    exec $SHELL -l
    

    step 4:

    toggle your iterm theme profile

    it2prof dark
    it2prof light
    

提交回复
热议问题