From 6d1a3c415482b587dbadc1323ff37c1319ecfd2e Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 1 Oct 2007 13:04:37 +0000 Subject: [PATCH] Added xterm status line prompt. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@72 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .profile.d/prompt.bashrc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .profile.d/prompt.bashrc diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc new file mode 100644 index 0000000..58c2222 --- /dev/null +++ b/.profile.d/prompt.bashrc @@ -0,0 +1,17 @@ +# $Id$ +# +# Set the title of an xterm to the hostname. +# + +SSH_FORWARDED=$(get_remote_ip -n) +if [ ! -z "$SSH_FORWARDED" ]; then + if [ ! "$SSH_FORWARDED" = "10.99.10.121" -a ! "$SSH_FORWARDED" = "ip01pc" ]; then + SSH_FORWARDED=" (from $SSH_FORWARDED)" + else + SSH_FORWARDED= + fi +fi +info="$HOSTNAME$SSH_FORWARDED" +blank=$(echo $info | sed 's/./ /g') +export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r$blank\r'" +unset info blank SSH_FORWARDED -- 2.20.1