]> git.phdru.name Git - dotfiles.git/commitdiff
bash: Separate host from current dir in `PS1` with `:`
authorOleg Broytman <phd@phdru.name>
Fri, 12 Jun 2020 14:51:24 +0000 (17:51 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 12 Jun 2020 14:53:05 +0000 (17:53 +0300)
.profile
.shellrc

index 89b65dc3c6b58e03234e43ac0dba93c9e830cc65..008efd533d064cc23923f435759964ff65c572ac 100644 (file)
--- a/.profile
+++ b/.profile
@@ -194,9 +194,9 @@ if [ -t 0 ] ; then
 
       if [ -r "$HOME"/admin/prog/bash_prompt ]; then
          . "$HOME"/admin/prog/bash_prompt
 
       if [ -r "$HOME"/admin/prog/bash_prompt ]; then
          . "$HOME"/admin/prog/bash_prompt
-         OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5} \`short_curdir\` \\$"
+         OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5}:\`short_curdir\` \\$"
       else
       else
-         OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$"
+         OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h:\W \\$"
       fi
       . "$ENV"
 
       fi
       . "$ENV"
 
index 56051caf9037a6da929c2c19f94619e117e0aeee..6973d7ab0a04a70423b66f9290b2eb96a8a18ccb 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -57,6 +57,7 @@ case "$HOME" in
    ;;
 esac
 
    ;;
 esac
 
+PS1="$OPS1$SHLVL "
 
 if test -n "$BASH_VERSION"; then
    [ "`type -t ls`" = alias ] && unalias ls
 
 if test -n "$BASH_VERSION"; then
    [ "`type -t ls`" = alias ] && unalias ls
@@ -342,9 +343,9 @@ mc() {
    if test -n "$BASH_VERSION"; then
       MC_SAVE_OPS1="$OPS1"
       if [ "`type -t short_curdir`" = function ]; then
    if test -n "$BASH_VERSION"; then
       MC_SAVE_OPS1="$OPS1"
       if [ "`type -t short_curdir`" = function ]; then
-         OPS1="\u@\${HOSTNAME::5} \`short_curdir\` \\$"
+         OPS1="\u@\${HOSTNAME::5}:\`short_curdir\` \\$"
       else
       else
-         OPS1="\u@\h \W \\$"
+         OPS1="\u@\h:\W \\$"
       fi
    fi
 
       fi
    fi