From 640313d05d5918455c8e95fbb668bffe8b7617dd Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 6 May 2008 11:46:28 +0100 Subject: [PATCH] fix prompt for root --- .zsh/zshrc/90_prompt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.zsh/zshrc/90_prompt b/.zsh/zshrc/90_prompt index fcb97f4..3e9365d 100644 --- a/.zsh/zshrc/90_prompt +++ b/.zsh/zshrc/90_prompt @@ -8,9 +8,15 @@ # Source repository: http://git.madduck.net/v/etc/zsh.git # -is_root && PS1_HL=U -PS1="%${PS1_HL:=B}%m%${(L)PS1_HL}:%1v%(2v.|%B%2v%b|.)%(3v.%3v.)%# " -unset PS1_HL +_MIDDLE="%1v%(2v.|%B%2v%b|.)%(3v.%3v.)" +if is_root; then + _MIDDLE="%25<..<%~%<<" + _PS1_HL=U +fi +PS1="%${_PS1_HL:=B}%m%${(L)_PS1_HL}:i${MIDDLE}%# " +unset _PS1_HL +unset _MIDDLE + RPS1="#%(0?..%?,)%!" # vim:ft=zsh -- 2.39.2