From ff0930a917171afe56545d1163555e32831de2ab Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 24 Aug 2018 15:37:51 -0400 Subject: Show hostname in title over SSH --- home/.kshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'home') 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 " -- cgit 1.4.1