summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--portable-prompt.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/portable-prompt.sh b/portable-prompt.sh
index 1ea948b..926e447 100644
--- a/portable-prompt.sh
+++ b/portable-prompt.sh
@@ -39,6 +39,17 @@ prompt_helper(){
 		RET="[$RET]"
 	fi
 
+	local pwd
+	case $PWD in
+	$HOME*)
+		pwd="~${PWD#"$HOME"}"
+		;;
+	*)
+		pwd=$PWD
+		;;
+	esac
+	PWEXT=$pwd
+
 	if [ "$CHECKWINSIZE" ]; then
 		set -- $(stty size)
 		export LINES=$1
@@ -85,17 +96,6 @@ pretty_title(){
         fi
         local host=${DISPLAYHOST-$HOSTNAME}
         local tty="(${COLUMNS}x${LINES} ${TTY})"
-	local pwd
-	case $PWD in
-	$HOME*)
-		pwd="~${PWD#"$HOME"}"
-		;;
-	*)
-		pwd=$PWD
-		;;
-	esac
-	PWEXT=$pwd
-
         #local pwd=${PWD/$HOME/~}
 
         if [ -n "$extra" ]; then