From 3fb92fb9b55b3f1c1372b539f898ad7cf2bf7907 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 26 Mar 2015 11:24:01 +0100 Subject: [tmux][screen] termcaps, titles, prompt colors.. --- 01_Internal.zsh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to '01_Internal.zsh') diff --git a/01_Internal.zsh b/01_Internal.zsh index eafc0a4..844823c 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -57,22 +57,24 @@ __term_title() screen*) local _sep="" [ $# -gt 0 ] && _sep=$1 && shift # gets and discards the separator, if any. - #if [ ! -z "$TMUX" ] - #then - # Tmux - #print -Pn "\e]0;%n@%m (%l) %~${_sep:+$_sep #[fg=yellow,bold]}$@\a" # Sets term title - print -Pn "\e]0;#[fg=red]%n#[fg=default,bold]@#[fg=red]%m#[default] (#[fg=cyan]%l#[fg=default]) #[fg=red]%~${_sep:+#[default,fg=default]$_sep #[fg=yellow,bold]}$(echo $@|sed 's/%/%%/g')\a" - #else - # Classic screen - # hardstatus - #print -Pn "\e]2;{+b W}SCREEN #n {-b W}| {R}?u(u) ?{W}{r}%n@%m{W} ({c}%l{W}) {R}%~{W}${_sep:+$_sep \{+b Y\}}$@{-b W}\a" # Sets hardstatus line (term title) - # print -Pn "\e]2;{R}?u(u) ?{W}{r}%n{R}@{r}%m{-b W} ({+b c}%l{-b W}) {R}%~{W}${_sep:+$_sep \{+b Y\}}$@{-b W}\a" # Sets hardstatus line (term title) - # caption - # print -Pn "\ek" - # [ "$SUDO_USER" != "" ] && print -Pn "($USER) " - # print -Pn "${@:-%~}" - # print -Pn "\e\\" - #fi + # Tmux + #print -Pn "\e]0;%n@%m (%l) %~${_sep:+$_sep #[fg=yellow,bold]}$@\a" # Sets term title + case $(_process_tree) in + *":: tmux ::"*) + print -Pn "\e]0;#[fg=red]%n#[fg=default,bold]@#[fg=red]%m#[default] (#[fg=cyan]%l#[fg=default]) #[fg=red]%~${_sep:+#[default,fg=default]$_sep #[fg=yellow,bold]}$(echo $@|sed 's/%/%%/g')\a" + ;; + *":: SCREEN ::"*) + # Classic screen + # hardstatus + #print -Pn "\e]2;{+b W}SCREEN #n {-b W}| {R}?u(u) ?{W}{r}%n@%m{W} ({c}%l{W}) {R}%~{W}${_sep:+$_sep \{+b Y\}}$@{-b W}\a" # Sets hardstatus line (term title) + #print -Pn "\e]2;{R}?u(u) ?{W}{r}%n{R}@{r}%m{-b W} ({+b c}%l{-b W}) {R}%~{W}${_sep:+$_sep \{+b Y\}}$@{-b W}\a" # Sets hardstatus line (term title) + # caption + #print -Pn "\ek" + #[ "$SUDO_USER" != "" ] && print -Pn "($USER) " + #print -Pn "${@:-%~}" + #print -Pn "\e\\" + ;; + esac ;; *) ;; -- cgit v1.2.3