Skip to content

Instantly share code, notes, and snippets.

@zz
Forked from bjeavons/steps.txt
Created February 18, 2016 13:56
Show Gist options
  • Save zz/11e66023e653ba1cb1d7 to your computer and use it in GitHub Desktop.
Save zz/11e66023e653ba1cb1d7 to your computer and use it in GitHub Desktop.
steps for changing term background color on any SSH
/*
* How to change background iTerm color on SSH when using fish shell
*/
// Put this in a file, replace RGB color with your current bgcolor. ex: original-bgcolor
tell application "iTerm"
tell the current terminal
tell the current session
set background color to {0,0,0}
end tell
end tell
end tell
// Put this in a file. ex: on-ssh-bgcolor
tell application "iTerm"
tell the current terminal
tell the current session
set background color to {12850,12850,12850}
end tell
end tell
end tell
// Create a bash script, make it executable and put it in your path. ex /usr/local/bin/ssh-bgcolor
#!/bin/bash
osascript ~/on-ssh-bgcolor
ssh $@
osascript ~/original-bgcolor
// Create a fish function for aliasing your ssh command. write the following to ~/.config/fish/functions/ssh.fish
alias ssh='/usr/local/bin/ssh-bgcolor'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment