diff options
-rw-r--r-- | 01_Functions.zsh | 19 | ||||
-rw-r--r-- | 12_Prompts.zsh | 2 | ||||
-rw-r--r-- | user:hugues/Environment.zsh | 5 |
3 files changed, 19 insertions, 7 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index 8824cab..87bc5b4 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -24,16 +24,22 @@ cmd_exists () term_title() { - # Jobs typeset -A command - for word in ${=2} ; command[$#comand]=$word + for word in ${=@} ; command[$#comand]=$word if [ "$command[0]" = "fg" ] then lastjob=$(ps ft `tty` | grep "[0-9]\+[[:blank:]]\+`tty | sed 's/\/dev\///'`[[:blank:]]\+T.\? \+.:.. \\\_ " | tail -n1 | cut -c32-) - set $1 $lastjob + set $lastjob + fi + if [ "$command[0]" = "screen" ] + then + # discards screen args + set "SCREEN" fi + [ ! "$@" = "" ] && set " |" $@ + [[ -t 1 ]] && case $TERM in sun-cmd) @@ -43,10 +49,11 @@ term_title() print -Pn "\e]0;%n@%m (%l) %~$@\a" # Sets term title ;; screen*) + local _sep="" + [ $# -gt 0 ] && _sep=$1 && shift # gets and discards the separator, if any. # hardstatus - print -Pn "\e]2;[SCREEN #n] ?u(u) ?%n@%m (%l) %~$@\a" # Sets hardstatus line (term title) + 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) # caption - [ $# -gt 0 ] && shift # discards the first arg, which is the separator, if any print -Pn "\ek" [ "$SUDO_USER" != "" ] && print -Pn "($USER) " print -Pn "${@:-%~}" @@ -135,7 +142,7 @@ get_git_branch () # Then the result my_git_branch="[rebase $current/$last: "$(git-name-rev --name-only $(cat $REBASE_DIR/onto))".."$my_git_branch"] "$(basename $(cat $REBASE_DIR/head-name)) else - # No rebase in progress, put '(' ')' if needed + # No rebase in progress, put '(' ')' if needed [ ! "$checkouted_branch" ] && my_git_branch="($my_git_branch)" fi diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 06c8611..890cee1 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -36,7 +36,7 @@ expand_text() preexec () { - term_title " --- " "$(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g;s/;$//')" + term_title "$(echo $1 | tr ' \n' ' ;' | sed 's/%/%%/g;s/\\/\\\\/g;s/;$//')" print -Pn "$C_$prompt_colors[exec]$_C" local lines="$(expand_text "$PROMPT$1" | sed "s/\\(.\{$COLUMNS\}\\)/\\1\\n/g" | wc -l)" diff --git a/user:hugues/Environment.zsh b/user:hugues/Environment.zsh index 1670723..07df513 100644 --- a/user:hugues/Environment.zsh +++ b/user:hugues/Environment.zsh @@ -8,6 +8,11 @@ ## NO WARRANTY PROVIDED, USE AT YOUR OWN RISKS ## + +export FULLNAME="Hugues Hiegel" +export EMAIL=${FULLNAME:+$FULLNAME <}hugues@hiegel.fr${FULLNAME:+>} + + ## Options pour ``bc'' # pour ne plus avoir # le message d'invite |