diff --git a/.screenrc b/.screenrc index 02b1368231e4aec7423b90846b2fd57346d15b64..9fada16ddd0f19131a92c6b75127e03d7d6c6f68 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 eea99b0e9efbab729e9523fe3cc7bd82a87e3caa..34a17ac36396d023d6297cc2f4517110d2a27e4a 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 ]] &&