Skip to content

Instantly share code, notes, and snippets.

@bjeavons
Created February 10, 2015 21:45
Show Gist options
  • Save bjeavons/6bb767c3619d8c6fa38e to your computer and use it in GitHub Desktop.
Save bjeavons/6bb767c3619d8c6fa38e 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