summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@anevia.com>2015-06-18 17:22:10 +0200
committerHugues Hiegel <hugues.hiegel@anevia.com>2015-06-18 17:22:10 +0200
commitb47eab76e3c6b46c027ca558936234d03aff93fc (patch)
tree125df0738dfb6a462062abb895843cbad336659f /12_Prompts.zsh
parent57a1cf10431e7c98663ddd11b7f27eaf80f222ba (diff)
[YeahConsole] ++
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh46
1 files changed, 30 insertions, 16 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index d252b05..37adec5 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -59,17 +59,23 @@ chpwd()
preexec ()
{
- __term_title "$2"
-
- __set_prompt_date exec
-
- # Only redraws the date, not the full prompt, since we got glitches with BANG_HIST and AUTOCORRECT...
- tput sc # save cursor position
- up_up # go to start of current prompt
- print -Pn "$(__show_date)" # prints date
- tput rc # restore cursor position
-
- print -Pn "$C_$_prompt_colors[exec]$_C"
+ __term_title "$2"
+ case "$_yeahconsole" in
+ "true")
+ ;;
+ *)
+
+ __set_prompt_date exec
+
+ # Only redraws the date, not the full prompt, since we got glitches with BANG_HIST and AUTOCORRECT...
+ tput sc # save cursor position
+ up_up # go to start of current prompt
+ print -Pn "$(__show_date)" # prints date
+ tput rc # restore cursor position
+ ;;
+ esac
+
+ print -Pn "$C_$_prompt_colors[exec]$_C"
}
__set_prompt_date()
@@ -87,11 +93,17 @@ __set_prompt_date()
__update_prompt_elements()
{
- __term_title
- __set_prompt_date
- __hbar
+ __term_title
+ case "$_yeahconsole" in
+ "true")
+ ;;
+ *)
+ __set_prompt_date
+ __hbar
- CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%~)"$C_$color[none]$_C
+ CURDIR=$C_$_prompt_colors[path]$_C"%(!.%d.%$(($(tput cols)-80))<…<%~)"$C_$color[none]$_C
+ ;;
+ esac
}
@@ -267,7 +279,9 @@ zle -N __redefine_prompt
__yeah_prompt ()
{
- PS1=$C_$prompt_color[default]$_C$C_$_prompt_colors[user]$_C"%n"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%m "$CURDIR${VCSBRANCH:+ $VCSBRANCH}" "$C_$_prompt_colors[dies]$_C">"$C_$_prompt_colors[cmd]$_C" "
+ #PS1=$C_$prompt_color[default]$_C$C_$_prompt_colors[user]$_C"%n"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%m "$CURDIR${VCSBRANCH:+ $VCSBRANCH}" "$C_$_prompt_colors[dies]$_C">"$C_$_prompt_colors[cmd]$_C" "
+ PS1=$C_$_prompt_colors[dies]$_C"] "
+ RPS1=$C_$_prompt_colors[path]$_C"%~"
PS2="$C_$_prompt_colors[soft_generic]$_C$(for i in {2..$#lastline} ; print -n "·" ; tput sc ; print -n "\r")$C_$color[yellow];$color[bold]$_C%_$(tput rc)$C_$color[none]$_C "
}