]> git.pld-linux.org Git - packages/bash.git/blobdiff - bashrc
- release 2
[packages/bash.git] / bashrc
diff --git a/bashrc b/bashrc
index 9c52184b86f529be6855ae472d8edb057a44b44b..5ef300fb445ea311b3f75044796ac68387864520 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -3,24 +3,30 @@
 # System wide functions and aliases
 # Environment stuff goes in /etc/profile
 
-# If shell is run in environment without set PS1
-if [ ! "$PS1" ]; then
-       case $TERM in
-               gnome|xterm*|rxvt)
-                       PS1="\[\033]0;\u@\h: \w\007\][\u@\h \W]\\$ "
-                       ;;
-               *)
-                       PS1="[\u@\h \W]\\$ "
-                       ;;
-       esac
+# Test for an interactive shell.  There is no need to set anything
+# past this point for scp and rcp, and it's important to refrain from
+# outputting anything in those cases.
+if [[ $- != *i* ]] ; then
+       # Shell is non-interactive.  Be done now!
+       return
 fi
 
+# If this is an xterm set the title to user@host:dir
+case $TERM in
+       gnome*|nxterm|xterm*|rxvt*|konsole*)
+               PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
+               ;;
+       *)
+               ;;
+esac
+PS1="[\u@\h \W]\\$ "
+
 alias which="type -p"
 
 # SYSTEM WIDE ALIASES ETC.
-for i in `find /etc/shrc.d -name '*.sh'` ; do
-       . $i
-done
-unset i
-
-stty erase `tput kbs`
+if [ "$(echo /etc/shrc.d/*.sh)" != "/etc/shrc.d/*.sh" ]; then
+       for i in /etc/shrc.d/*.sh; do
+               . $i
+       done
+       unset i
+fi
This page took 0.046855 seconds and 4 git commands to generate.