summaryrefslogtreecommitdiff
path: root/01_Internal.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2012-06-19 17:51:13 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2012-06-19 17:51:13 +0200
commitf718af82030c7a5d295ebff54482b184ec0a7e39 (patch)
treed070413234f59a68914dc14ae210c75f02f49053 /01_Internal.zsh
parent086bd94740186f5d616eacc0e974ca68b220b0fb (diff)
[Prompt] little display tweaks to speed up things. 'reset-prompt' zle rewritten.
Diffstat (limited to '01_Internal.zsh')
-rw-r--r--01_Internal.zsh16
1 files changed, 11 insertions, 5 deletions
diff --git a/01_Internal.zsh b/01_Internal.zsh
index 6ac5ec5..ee25c75 100644
--- a/01_Internal.zsh
+++ b/01_Internal.zsh
@@ -16,6 +16,10 @@
# go see the file Prompts.zsh
#
+_cuu1_=$(tput cuu1)
+_cud1_=$(tput cud1)
+_cub1_=$(tput cub 1)
+_cuf1_=$(tput cuf 1)
__cmd_exists ()
{
@@ -383,14 +387,15 @@ __get_prompt_lines()
# Rewrites current prompt.
__redisplay_ps1 ()
{
- tput sc
- up_up - 1
__redefine_prompt
+ tput sc
+ up_up - 1
print -Pn "$PS1"
tput rc
}
-zle -N __redisplay_ps1
+zle -D reset-prompt
+zle -N reset-prompt __redisplay_ps1
__clear ()
{
@@ -400,9 +405,10 @@ __clear ()
up_up ()
{
+ local _up=""
for i in {1..$(($(__get_prompt_lines) $@ ))}
- tput cuu1
- print -Pn '\r'
+ _up+=$_cuu1_
+ print -Pn $_up'\r'
}
_rehash ()