From c1fed1895a54fe85d8d1027772378c80da380513 Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sun, 15 Jun 2008 11:09:34 +0300 Subject: commented out code for remote session detection --- prompt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/prompt b/prompt index 92d7266..092e18e 100755 --- a/prompt +++ b/prompt @@ -170,20 +170,21 @@ export -f set_shell_title ########################################################### HOST ### we don't display home host/domain $SSH_* set by SSHD or keychain - # is sshd our perent? - if [[ "$SSH_AUTH_SOCK" ]] || - for ((pid=$$; $pid != 1 ; pid=`ppid_of $pid`)); do ps h -o command -p $pid; done | grep -q sshd - then + # I give up. How to find out if session is local or remote? Working with "su -", ssh-agent, and so on ? + ## is sshd our perent? + # if { for ((pid=$$; $pid != 1 ; pid=`ps h -o pid --ppid $pid`)); do ps h -o command -p $pid; done | grep -q sshd } + #then host=${HOSTNAME} #host=`hostname --short` - #host=`echo ${host%$default_host} | tr a-z A-Z` - host=`echo ${host} | tr a-z A-Z` - eval host_color=\$${host}_host_color - else - host="" - fi - - eval host_color="\$$host_color" + host=`echo ${host%$default_host} | tr a-z A-Z` + #host=`echo ${host} | tr a-z A-Z` + host_color=${host}_host_color + host_color=${!host_color} + #else + # host="" + #fi + + host_color=${!host_color} # we already should have short host name, but just in case host=${host%.localdoman} -- cgit v1.2.3