X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=bc164f1a305a08561600ff07a98d2340e8a79da8;hb=0addb50cbc67c7f01d0c34cd77eef7f135ff9c68;hp=a68887656de63857c2555f706cf45bd7462ce040;hpb=73569c892d64c96ae8d33d49589f9eb0c0643821;p=dotfiles.git diff --git a/.shellrc b/.shellrc index a688876..bc164f1 100644 --- a/.shellrc +++ b/.shellrc @@ -15,8 +15,6 @@ esac # Stop if non-interactive shell [ -z "$PS1" ] && return -PS1="$OPS1$SHLVL " - if test -n "$BASH_VERSION"; then # append to the history file, don't overwrite it shopt -s histappend @@ -59,7 +57,6 @@ case "$HOME" in ;; esac - if test -n "$BASH_VERSION"; then [ "`type -t ls`" = alias ] && unalias ls [ "`type -t ll`" = alias ] && unalias ll @@ -152,6 +149,11 @@ if test -n "$BASH_VERSION"; then fi complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser + if [ "`type -t short_curdir`" != function -a \ + -r "$HOME"/admin/prog/bash_prompt ]; then + . "$HOME"/admin/prog/bash_prompt + fi + #if type -p pip >/dev/null 2>&1; then # eval "`pip completion --bash`" # rm -rf /tmp/pip_build_"$USER" @@ -178,6 +180,7 @@ elif test -n "$KSH_VERSION" -o -n "$FCEDIT"; then j() { jobs; } fi +PS1="$OPS1" # clear screen and history, logout chlo() { clear; cd; >$HISTFILE; unset HISTFILE; history -c; logout || exit; } @@ -336,7 +339,12 @@ include() { mc() { if test -n "$BASH_VERSION"; then MC_SAVE_OPS1="$OPS1" - OPS1="\u@\h \W \\$" + if [ "`type -t short_curdir`" = function ]; then + OPS1="\`cgmem_which_prompt\`\u@\${HOSTNAME::5}:\`short_curdir\` " + OPS1+="\$(prompt_git)\\$\$SHLVL " + else + OPS1="\u@\h:\W \\$" + fi fi if [ -n "$SLOWTERM" ]; then