diff options
author | Hugues Hiegel <hugues.hiegel@openwide.fr> | 2009-11-23 10:42:46 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@openwide.fr> | 2009-11-23 11:00:32 +0100 |
commit | f47e5d9ec9992811cb7cc1f2927e1d194ed1fc09 (patch) | |
tree | b99633a67a70798ddacb19c440dacb68be9a8dca /01_Functions.zsh | |
parent | af3ca8747fcea13517b3c318bb0629c8ec284ab2 (diff) |
[Funcs] adapts term-title for tmux, based on screen
Diffstat (limited to '01_Functions.zsh')
-rw-r--r-- | 01_Functions.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index 2f19d07..a935155 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -55,7 +55,8 @@ term_title() 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;%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]$@}#[default,fg=default]\a" else # Classic screen # hardstatus @@ -150,7 +151,8 @@ get_git_branch () fi # Then the result - my_git_branch="[rebase $current/$last: "$(git-name-rev --name-only $(cat $REBASE_DIR/onto))".."$my_git_branch"] "$(< $REBASE_DIR/head-name sed 's/^refs\///;s/^heads\///') + my_git_branch="[rebase $current/$last: "$(git-name-rev --name-only "$(cat $REBASE_DIR/onto 2>/dev/null)" 2>/dev/null)".."$my_git_branch"]" + [ -r $REBASE_DIR/head-name ] && my_git_branch=$my_git_branch" "$(< $REBASE_DIR/head-name sed 's/^refs\///;s/^heads\///') else # No rebase in progress, put '(' ')' if needed [ ! "$checkouted_branch" ] && my_git_branch="($my_git_branch)" |