aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/themes
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2016-11-06 02:57:14 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2017-06-01 18:37:35 +0200
commitb6538e6139f0158099bd407bb737ed7b9af26e67 (patch)
tree75abfba977383f5539c048644148ed0810711983 /zsh/themes
parent9188fba3b14c331744b8593138f9496adea4ea60 (diff)
downloaddotfiles-b6538e6139f0158099bd407bb737ed7b9af26e67.tar.xz
Move preexec to theme
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Diffstat (limited to 'zsh/themes')
-rw-r--r--zsh/themes/prompt_kyrias_setup11
1 files changed, 10 insertions, 1 deletions
diff --git a/zsh/themes/prompt_kyrias_setup b/zsh/themes/prompt_kyrias_setup
index 68dbfd8..7082677 100644
--- a/zsh/themes/prompt_kyrias_setup
+++ b/zsh/themes/prompt_kyrias_setup
@@ -19,13 +19,22 @@ venv_prompt() {
}
prompt_kyrias_precmd() {
- print -Pn "\e];%n %~\a"
+ # Print line to the window title
+ print -P "\e];%n %~\a"
+}
+
+prompt_kyrias_preexec() {
+ # Print currently running command name to the window title
+ print -P "\e];$1:q\a"
}
prompt_kyrias_setup() {
setopt prompt_subst
autoload -U colors && colors
+ add-zsh-hook precmd prompt_kyrias_precmd
+ add-zsh-hook preexec prompt_kyrias_preexec
+
PROMPT='%{$bg[$(prompt_user_color)]$fg[white] %m %k%f$bg[white]$fg[$(prompt_user_color)] %~ %f%k$(venv_prompt)
$bg[blue]%} λ %k %}'
}