diff options
| -rw-r--r-- | shell/ash | 17 | ||||
| -rw-r--r-- | shell/bash | 38 |
2 files changed, 32 insertions, 23 deletions
@@ -1,19 +1,18 @@ +color="no" +case "$TERM" in + xterm*) color=yes;; + *256color) color=yes;; +esac + case "$-" in *i*) set_pager set_editor setaliases - function nonzero_return() { - RETVAL=$? - [ $RETVAL -ne 0 ] && echo "$RETVAL:" - } - - export PS1="\`nonzero_return\`[\t] <\u@\H> \w \\$ " - - # Same thing but red user/host combo + export PS1="$ " if [ $(id -u) -eq 0 ] ; then - export PS1="\`nonzero_return\`[\t] <\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\H\[\e[m\]> \w \\$ " + export PS1="# " fi ;; *) return ;; @@ -1,8 +1,16 @@ +color="no" +case "$TERM" in + xterm*) color=yes;; + *256color) color=yes;; +esac + +if [ "$color" = "yes" ] ; then + colormanpages + setcolorterminal + setcoloraliases + setlscolors +fi -colormanpages -setcolorterminal -setcoloraliases -setlscolors set_pager set_editor set_go @@ -14,14 +22,16 @@ export MANWIDTH=80 # checkSSHAgent -function nonzero_return() { - RETVAL=$? - [ $RETVAL -ne 0 ] && echo "$RETVAL:" -} +case "$-" in +*i*) + set_pager + set_editor + setaliases -export PS1="\`nonzero_return\`[\t] <\u@\H> \w \\$ " - -# Same thing but red user/host combo -if [ $(id -u) -eq 0 ] ; then - export PS1="\`nonzero_return\`[\t] <\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\H\[\e[m\]> \w \\$ " -fi + export PS1="$ " + if [ $(id -u) -eq 0 ] ; then + export PS1="# " + fi +;; +*) return ;; +esac |
