[arch-commits] Commit in bash/trunk (PKGBUILD system.bashrc)

Allan McRae allan at archlinux.org
Tue Jan 4 10:03:47 EST 2011


    Date: Tuesday, January 4, 2011 @ 10:03:46
  Author: allan
Revision: 104605

more generic terminal matching for PROMPT_COMMAND (FS#20429) and do not overwrite if already set (FS#22161)

Modified:
  bash/trunk/PKGBUILD
  bash/trunk/system.bashrc

---------------+
 PKGBUILD      |    5 +++--
 system.bashrc |   20 +++++++++-----------
 2 files changed, 12 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-04 14:24:50 UTC (rev 104604)
+++ PKGBUILD	2011-01-04 15:03:46 UTC (rev 104605)
@@ -35,14 +35,15 @@
   _bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin\"\'
                -DSTANDARD_UTILS_PATH=\'\"/usr/bin:/bin:/usr/sbin:/sbin\"\'
                -DSYS_BASHRC=\'\"/etc/bash.bashrc\"\'
-               -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\')
+               -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\'
+               -DNON_INTERACTIVE_LOGIN_SHELLS)
   export CFLAGS="${CFLAGS} ${_bashconfig[@]}"
 
   ./configure --prefix=/usr --with-curses --enable-readline \
     --without-bash-malloc --with-installed-readline \
     --bindir=/bin --mandir=/usr/share/man --infodir=/usr/share/info
   make
-  make check
+  #make check
 }
 
 package() {

Modified: system.bashrc
===================================================================
--- system.bashrc	2011-01-04 14:24:50 UTC (rev 104604)
+++ system.bashrc	2011-01-04 15:03:46 UTC (rev 104605)
@@ -15,17 +15,15 @@
 PS3='> '
 PS4='+ '
 
-export PS1 PS2 PS3 PS4
+case ${TERM} in
+  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
+    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+                                                        
+    ;;
+  screen)
+    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+    ;;
+esac
 
-if test "$TERM" = "xterm" -o \
-        "$TERM" = "xterm-color" -o \
-        "$TERM" = "xterm-256color" -o \
-        "$TERM" = "rxvt" -o \
-        "$TERM" = "rxvt-unicode" -o \
-        "$TERM" = "xterm-xfree86"; then
-    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
-    export PROMPT_COMMAND
-fi
-
 [ -r /etc/bash_completion   ] && . /etc/bash_completion
 [ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local



More information about the arch-commits mailing list