aboutsummaryrefslogtreecommitdiffstats
path: root/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc20
1 files changed, 20 insertions, 0 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 29f863c..ab6638c 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -38,6 +38,26 @@ setopt autocd \
# Menu completion
zstyle ':completion:*' menu select
+function get_git_branch {
+ if [[ -d .git ]]; then
+ branch=" $(git rev-parse --abbrev-ref HEAD) "
+ else
+ branch=" "
+ fi
+}
+
+# Print basic prompt to the window title
+function precmd {
+ print -Pn "\e];%n %~\a"
+ get_git_branch
+}
+
+# Print the current running command's name to the window title
+function preexec {
+ local cmd=${1[(wr)^(*=*|sudo|exec|ssh|-*)]}
+ print -Pn "\e];$cmd:q\a"
+}
+
if [[ $TERM == xterm-termite && $DISPLAY == ":0" ]]; then
. /etc/profile.d/vte.sh
__vte_osc7