summary refs log tree commit diff
path: root/home/.kshrc
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-24 15:37:51 -0400
committerJune McEnroe <june@causal.agency>2018-08-24 15:37:51 -0400
commitf8675036b10983e97c1266786f6c9f13213c766b (patch)
treed527abaf4562b43248c4eb4aacacf91c3a1dfb6b /home/.kshrc
parentAlias bc='bc -l' (diff)
downloadsrc-f8675036b10983e97c1266786f6c9f13213c766b.tar.gz
src-f8675036b10983e97c1266786f6c9f13213c766b.zip
Show hostname in title over SSH
Diffstat (limited to 'home/.kshrc')
-rw-r--r--home/.kshrc7
1 files changed, 6 insertions, 1 deletions
diff --git a/home/.kshrc b/home/.kshrc
index 6813bb5d..91d01bc7 100644
--- a/home/.kshrc
+++ b/home/.kshrc
@@ -63,6 +63,7 @@ function branch {
 	fi
 }
 
+hostname=$(hostname)
 whence realpath > /dev/null && HOME=$(realpath "$HOME")
 function prompt {
 	typeset status=$?
@@ -72,7 +73,11 @@ function prompt {
 	title=${path##*/}
 	right="${path}$(branch)"
 
-	[[ -n ${SSH_CLIENT:-} ]] && color=${fg[5]} || color=${fg[7]}
+	color=${fg[7]}
+	if [[ -n ${SSH_CLIENT:-} ]]; then
+		color=${fg[5]}
+		title="${hostname%%.*}:${title}"
+	fi
 	(( status )) && color=${fg[1]}
 	left="\01${color}\01\$\01${fg}\01 "