aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/oh-my-zsh
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2021-12-14 15:33:32 +0000
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2021-12-14 15:33:32 +0000
commitb61c8715cf8f6154e2e4ed6aecdc12ff2c91d461 (patch)
tree7ae4e168d2a936e5a5ebcb32f7f235a5342c1693 /zsh/oh-my-zsh
parenta8eccf74df77f9004a6e4ee09daad73c9e30912d (diff)
Add oh-my-zsh scripts
Diffstat (limited to 'zsh/oh-my-zsh')
-rw-r--r--zsh/oh-my-zsh/iTerm2-ssh.zsh28
1 files changed, 28 insertions, 0 deletions
diff --git a/zsh/oh-my-zsh/iTerm2-ssh.zsh b/zsh/oh-my-zsh/iTerm2-ssh.zsh
new file mode 100644
index 0000000..6f19818
--- /dev/null
+++ b/zsh/oh-my-zsh/iTerm2-ssh.zsh
@@ -0,0 +1,28 @@
+function tabc() {
+ NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi
+ echo -e "\033]50;SetProfile=$NAME\a"
+}
+
+function tab-reset() {
+ NAME="Default"
+ echo -e "\033]50;SetProfile=$NAME\a"
+}
+
+function colorssh() {
+ if [[ -n "$ITERM_SESSION_ID" ]]; then
+ trap "tab-reset" INT EXIT
+ if [[ "$*" =~ "ceres" ]]; then
+ tabc "SSH - Ceres"
+ elif [[ "$*" =~ "ug04" || "$*" =~ "tw" ]]; then
+ tabc "SSH - SoCS"
+ else
+ tabc "SSH - Unknown"
+ fi
+# tabc SSH
+ fi
+ ssh $*
+}
+compdef _ssh tabc=ssh
+
+alias ssh="colorssh"
+