From b3f14c0ce09c46ceb54d2bf09e2d0d8ba218aab0 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 9 Jul 2009 11:10:01 +0200 Subject: [TermTitle] new caption --- 01_Functions.zsh | 19 +++++++++++++------ 12_Prompts.zsh | 2 +- 2 files changed, 14 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)" -- cgit v1.2.3 From f19d8bc2ce50e210771d36ad43b6da905b2c8912 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 9 Jul 2009 11:10:50 +0200 Subject: [Aliases] dict uses hiegel.fr and no more localhost --- user:hugues/Aliases.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user:hugues/Aliases.zsh b/user:hugues/Aliases.zsh index c1ee2ec..c8f16ec 100644 --- a/user:hugues/Aliases.zsh +++ b/user:hugues/Aliases.zsh @@ -73,7 +73,7 @@ a lc='ls -c' a lc1='\ls -c1' cmd_exists dict && a definition='dict -h dict.org' -cmd_exists dict && a traduction='dict -h localhost -P-' +cmd_exists dict && a traduction='dict -h hiegel.fr -P-' cmd_exists dosbox && a dosbox='dosbox -c "mount c \"`pwd`\"" -c "mount d /cdrom -t cdrom" -c "c:" ' cmd_exists emacs && a gnus='emacs -f gnus' -- cgit v1.2.3 From cbe3e7fc5a6b8d77c783dbc88b0ab10a9eb25a66 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 9 Jul 2009 11:11:29 +0200 Subject: [Env] hg-compliant variables (EMAIL and FULLNAME) --- user:hugues/Environment.zsh | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3