Last active
November 3, 2021 16:11
-
-
Save wangchen/18b037ceb009fcb0df87 to your computer and use it in GitHub Desktop.
Revisions
-
wangchen revised this gist
Jul 31, 2015 . 1 changed file with 6 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,14 @@ # Usage: # Change profile when using ssh. # You MUST define a profile named 'ForSSH' with diferent settings. # I am using color schemes with different background color. # Then: # $ save as ~/.iterm2.zsh # $ echo ". ~/.iterm2.zsh" >> ~/.zshrc # iTerm2 window/tab color commands # Requires iTerm2 >= Build 1.0.0.20110804 # http://iterm2.com/documentation-escape-codes.html profile-change() { echo -ne "\033]50;SetProfile=ForSSH\a" -
wangchen revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # iTerm2 window/tab color commands # Requires iTerm2 >= Build 1.0.0.20110804 # http://iterm2.com/documentation-escape-codes.html tab-color() { echo -ne "\033]6;1;bg;red;brightness;$1\a" echo -ne "\033]6;1;bg;green;brightness;$2\a" -
wangchen created this gist
Jul 31, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ # Usage: # source iterm2.zsh # iTerm2 window/tab color commands # Requires iTerm2 >= Build 1.0.0.20110804 # http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes 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-reset() { echo -ne "\033]6;1;bg;*;default\a" } profile-change() { echo -ne "\033]50;SetProfile=ForSSH\a" echo -ne "\033]50;SetProfile=ForSSH\a" } profile-reset() { echo -ne "\033]50;SetProfile=Default\a" } # Change the color of the tab when using SSH # reset the color after the connection closes color-ssh() { if [[ -n "$ITERM_SESSION_ID" ]]; then trap "profile-reset" INT EXIT profile-change fi ssh $* } compdef _ssh color-ssh=ssh alias ssh=color-ssh