summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2012-03-12 17:12:36 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2012-03-12 17:12:36 +0100
commit6dbc777536af9535a87847e20fe4d9d63753d124 (patch)
tree37420991e9c34e62970a64ace8da2dffc405b9b0 /12_Prompts.zsh
parentbd5a27f6b7b80a7761cff169568ce63dfa7c5c89 (diff)
[Prompts] Takes into account empty new-lines at end of prompt input.
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh3
1 files changed, 3 insertions, 0 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index 7448eb4..ec88067 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -90,6 +90,9 @@ preexec ()
local lines
lines=$( (__expand_text "$PS1 $1" ) | sed "s/\\(.\{,$COLUMNS\}\\)/\\1\n/g" )
lines=$( echo "$lines" | sed -n '/^$/n;p' | wc -l )
+ # Got number of empty lines at end of command, because they are screwed up above...
+ lines=$(( $lines + $( echo -n "$1" | tr ';\n' '.;' | sed 's/^\(.*[^;]\)\(;*\)$/\2/' | wc -c ) ))
+
tput sc
# /TODO/ GET A WAY TO KNOW IF THERE HAVE BEEN AN HIST_BANG OR NOT...
for i in {1..$lines} ; tput cuu1