X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=.bashrc;h=bf7e6d73d895816e53f5a0e9c3a9f3b00dbf1928;hb=cf7f0abb7657b4f211bca3225f1affa86415dafe;hp=74cc23288bfca279202e8fdde7c864edd04f9977;hpb=ff73a3e6fd8ae56fada5050821e60df2b292fdbe;p=config-20-100.git diff --git a/.bashrc b/.bashrc index 74cc232..bf7e6d7 100644 --- a/.bashrc +++ b/.bashrc @@ -98,11 +98,11 @@ get_vcs_info () { # Rien de spécial n'arrivera si vous n'avez pas le fichier .umaskrc function cd { builtin cd "$@" + ret=$? if [ -f ~/.umaskrc ]; then - umask $(/usr/bin/awk 'BEGIN {pwd=ENVIRON["PWD"]; a=length(pwd); cmax=0} {if($1==pwd) {MASK=$2;exit}; c=length($1); if(c>a) {next}; if(substr(pwd,0,c)==$1 && c > cmax) {cmax=c; MASK=$2}} END {print MASK}' ~/.umaskrc) >/dev/null - else - return 0 + umask $(/usr/bin/awk 'BEGIN {pwd=ENVIRON["PWD"]"/"; a=length(pwd); cmax=0} {if($1==pwd) {MASK=$2;exit}; c=length($1); if(c>a) {next}; if(substr(pwd,0,c+1)==$1 && c > cmax) {cmax=c; MASK=$2}} END {print MASK}' ~/.umaskrc) >/dev/null fi + return $ret } ### Attention à ce que vous éditez dans cette section ### @@ -171,6 +171,11 @@ else color_prompt=no fi +# Est-ce qu'on veut que le prompt affiche les information sur l'éventuel dépôt +# versionné dans lequel on se trouve +#~# # Changez cette variable en "yes" pour l'afficher +display_vcs_info=no + # Génération de la ligne de "-" function gen_minus_line @@ -195,7 +200,9 @@ function prompt_command # À décommenter si on veut des infos # quand on se trouve dans un dépôt versionné - get_vcs_info + if [ "$display_vcs_info" = yes ]; then + get_vcs_info + fi pwd=${PWD/#$HOME/'~'} if (( ${#pwd} + ${VCS_size} + 27 > COLUMNS )); then