修改Items2的Tab颜色
增加一个items插件 # /Users/vincentmi/.oh-my-zsh-custom if [[ -n "$ITERM_SESSION_ID" ]]; then tab-color() { echo -ne "\033]6;1;bg;red;brightness;$1\a" echo -ne "\033]6;1;bg;green;brightness;$2\a" echo -ne "\033]6;1;bg;blue;brightness;$3\a" } tab-red() { tab-color 255 0 0 } tab-green() { tab-color 0 255 0 } tab-blue() { tab-color 0 0 255 } tab-reset() { echo -ne "\033]6;1;bg;*;default\a" } function iterm2_tab_precmd() { tab-reset } # function iterm2_tab_preexec() { # if [[ "$1" =~ "^ssh " ]]; then # if [[ "$1" =~ "prod" ]]; then # tab-color 255 160 160 # else # tab-color 160 255 160 # fi # else # tab-color 160 160 255 # fi # } function iterm2_tab_preexec() { if [[ "$1" =~ "^ssh " ]]; then if [[ "$1" =~ "prod" || "$1" =~ "live" ]]; then tab-color 220 20 60 else if [[ "$1" =~
Posted by Vincent on Sunday, April 7, 2024