]> piware.de Git - bin.git/commitdiff
shellpresent: return to $ prompt after command finished, looks more natural
authormartin@piware.de <>
Sat, 4 Apr 2009 15:03:33 +0000 (08:03 -0700)
committermartin@piware.de <>
Sat, 4 Apr 2009 15:03:33 +0000 (08:03 -0700)
shellpresent

index 8747d887e62acacf4cbac367f279743d649508c2..a9720d6556b50480aaea377448a4ea1e42755571 100755 (executable)
 }
 
 clear
+echo -en "\e[31m\$\e[30m "
 
 while read line; do
     # paragraph clears screen
     if [ -z "$line" ]; then
        clear
+       echo -en "\e[31m\$\e[30m "
        continue
     fi
 
     # comment
     if [ "${line:0:1}" = "#" ]; then
        if [ -n "${line:1}" ]; then
-           echo -e "\e[32m$line\e[30m"
+           echo -e "\r\e[32m$line\e[30m"
+           echo -en "\e[31m\$\e[30m "
        fi
        continue
     fi
 
     # execute command
-    echo -en "\e[31m\$\e[30m $line"
+    echo -n "$line"
     read < /dev/tty
     eval "$line"
-    read < /dev/tty
+    echo -en "\n\e[31m\$\e[30m "
+    read -s < /dev/tty
 done < "$1"