X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=6973d7ab0a04a70423b66f9290b2eb96a8a18ccb;hb=c954ff3610e4bfb71e0c5bc2fb3ebca5938fdc44;hp=5b1e1d3db39e784807906f1446974f0824843281;hpb=1102e6b795191917acd9686e93af3c48b0ed3fc3;p=dotfiles.git diff --git a/.shellrc b/.shellrc index 5b1e1d3..6973d7a 100644 --- a/.shellrc +++ b/.shellrc @@ -57,16 +57,7 @@ case "$HOME" in ;; esac - -# Remove trainling \$s -OPS1="`echo $OPS1 | sed 's/[ \\$]\+$//'`" -# Add a trainling space -OPS1="$OPS1 " -# Re-add trainling \$ -for ((i=0; i<$SHLVL; i++)); do OPS1="$OPS1\\$"; done - -PS1="$OPS1 " - +PS1="$OPS1$SHLVL " if test -n "$BASH_VERSION"; then [ "`type -t ls`" = alias ] && unalias ls @@ -160,6 +151,13 @@ 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 + + PS1="\`cgmem_which_prompt\`$OPS1$SHLVL " + #if type -p pip >/dev/null 2>&1; then # eval "`pip completion --bash`" # rm -rf /tmp/pip_build_"$USER" @@ -344,7 +342,11 @@ include() { mc() { if test -n "$BASH_VERSION"; then MC_SAVE_OPS1="$OPS1" - OPS1="\u@\h " + if [ "`type -t short_curdir`" = function ]; then + OPS1="\u@\${HOSTNAME::5}:\`short_curdir\` \\$" + else + OPS1="\u@\h:\W \\$" + fi fi if [ -n "$SLOWTERM" ]; then