iTerm 2 profiles

前端 未结 7 1715
庸人自扰
庸人自扰 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:41

    iTerm2 supports a custom escape code that changes the profile on the fly. Put it in your .bashrc or .bash_profile.

    ]50;SetProfile=X^G
    

    where X is the profile. For instance, to change the profile to one called "Foo", us this shell script:

    #!/bin/bash
    echo -e "\033]50;SetProfile=Foo\a"
    

    To change it back when you log out, put code to change the profile back to default in ~/.bash_logout.

提交回复
热议问题