From a8c949e17fd52c7a7871b71286fcc256ec60d918 Mon Sep 17 00:00:00 2001 From: Murukesh Mohanan Date: Tue, 15 Aug 2017 16:32:44 +0900 Subject: [PATCH] update screenrc --- .screenrc | 2 +- .zshrc | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.screenrc b/.screenrc index 02b1368..9fada16 100644 --- a/.screenrc +++ b/.screenrc @@ -1,7 +1,7 @@ autodetach on startup_message off hardstatus alwayslastline -shelltitle '$SHELL' +#shelltitle "$PWD" hardstatus string '%{gk}[%{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= w}%?%+Lw%?%? %{g}][%{d}%l%{g}][ %{= w}%Y/%m/%d %0C:%s%a%{g} ]%{W}' term screen-256color diff --git a/.zshrc b/.zshrc index eea99b0..34a17ac 100644 --- a/.zshrc +++ b/.zshrc @@ -179,6 +179,19 @@ autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd v edit-command-line +if [[ $TERM = screen* ]] +then + # If running in screen, set the window title to the command about to be executed + preexec() { + [ -n "$WINDOW" ] && print -Pn "\ek$2\e\\" + } + + # If in screen, blank the window title when displaying the prompt + precmd() { + [ -n "$WINDOW" ] && print -Pn "\ek-\e\\" + } +fi + # [[ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]] && # . ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh [[ -f ~/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh ]] && -- 2.24.1