Created
September 16, 2015 14:00
-
-
Save mattmacleod/250ea789e138ce83b82c to your computer and use it in GitHub Desktop.
This file contains 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 characters
function set_iterm2_background_color() { | |
/usr/bin/osascript <<EOF | |
tell application "iTerm" | |
tell the current terminal | |
tell the current session | |
set background color to $@ | |
end tell | |
end tell | |
end tell | |
EOF | |
} | |
function get_iterm2_background_color() { | |
/usr/bin/osascript <<EOF | |
tell application "iTerm" | |
tell the current terminal | |
tell the current session | |
get background color | |
end tell | |
end tell | |
end tell | |
EOF | |
} | |
launch_ssh_with_colors() { | |
OLD_ITERM_BACKGROUND_COLOR="{$(get_iterm2_background_color)}" | |
set_iterm2_background_color {32000, 0, 0} | |
ssh $@ | |
set_iterm2_background_color $OLD_ITERM_BACKGROUND_COLOR | |
} | |
alias ssh=launch_ssh_with_colors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment