Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
dc87b81b
Commit
dc87b81b
authored
14 years ago
by
Dieter Plaetinck
Browse files
Options
Download
Email Patches
Plain Diff
reset exit code visual cues (not exit code itself) after showing once
parent
e5beb1a6
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
themes/dieter.zsh-theme
+26
-6
themes/dieter.zsh-theme
with
26 additions
and
6 deletions
+26
-6
themes/dieter.zsh-theme
View file @
dc87b81b
...
@@ -2,21 +2,25 @@
...
@@ -2,21 +2,25 @@
# and colorcoding, which bring useful visual cues. While limiting the amount of colors and such to keep
# and colorcoding, which bring useful visual cues. While limiting the amount of colors and such to keep
# it easy on the eyes
# it easy on the eyes
# exact return code (when >0) is on the right, so it stays out of the way
# exact return code (when >0) is on the right, so it stays out of the way
# The visual cues for >0 exit codes will only display once
# TODO: reset exit code visual cues (not exit code itself) after showing once
# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
# TODO: compress hostname in window title
typeset -A host_repr
typeset -A host_repr
host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
# local time, color coded after last return code
# local time, color coded after last return code
local time="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
time_disabled="%{$fg[green]%}%*%{$reset_color%}"
time=$time_enabled
# user part, color coded after privileges
# user part, color coded after privileges
local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
# Hostname part. compressed and colorcoded per host_repr array
# Hostname part. compressed and colorcoded per host_repr array
# if not found, regular hostname in default color
# if not found, regular hostname in default color
local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
# Compacted $PWD
# Compacted $PWD
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
...
@@ -29,5 +33,21 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$rese
...
@@ -29,5 +33,21 @@ ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$rese
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
# elaborate exitcode on the right when >0
# elaborate exitcode on the right when >0
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
RPS1="${return_code}"
return_code_disabled=
return_code=$return_code_enabled
RPS1='${return_code}'
function accept-line-or-clear-warning () {
if [[ -z $BUFFER ]]; then
time=$time_disabled
return_code=$return_code_disabled
else
time=$time_enabled
return_code=$return_code_enabled
fi
zle accept-line
}
zle -N accept-line-or-clear-warning
bindkey '^M' accept-line-or-clear-warning
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help