Created
September 2, 2026 12:33
-
-
Save jjeffers/92ff50132d48146d338e25c004212085 to your computer and use it in GitHub Desktop.
Terminal color adjustment for ssh into different environments
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 characters
| ssh() { | |
| # Change profile for a specific host | |
| if [[ "$1" == "prod-server" ]]; then | |
| # Set profile to Red (or any custom profile name you created) | |
| echo -e "\033]50;SetTerminalHeader=PROD SERVER\a" | |
| osascript -e 'tell application "Terminal" to set current settings of selected tab of front window to settings set "Pro"' | |
| # Run SSH | |
| command ssh "$@" | |
| # Reset back to default profile on exit | |
| osascript -e 'tell application "Terminal" to set current settings of selected tab of front window to settings set "Basic"' | |
| else | |
| command ssh "$@" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment