From c954ff3610e4bfb71e0c5bc2fb3ebca5938fdc44 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 12 Jun 2020 17:51:24 +0300 Subject: [PATCH] bash: Separate host from current dir in `PS1` with `:` --- .profile | 4 ++-- .shellrc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.profile b/.profile index 89b65dc..008efd5 100644 --- 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 - OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5} \`short_curdir\` \\$" + OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\${HOSTNAME::5}:\`short_curdir\` \\$" else - OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$" + OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h:\W \\$" fi . "$ENV" diff --git a/.shellrc b/.shellrc index 56051ca..6973d7a 100644 --- a/.shellrc +++ b/.shellrc @@ -57,6 +57,7 @@ case "$HOME" in ;; esac +PS1="$OPS1$SHLVL " 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 - OPS1="\u@\${HOSTNAME::5} \`short_curdir\` \\$" + OPS1="\u@\${HOSTNAME::5}:\`short_curdir\` \\$" else - OPS1="\u@\h \W \\$" + OPS1="\u@\h:\W \\$" fi fi -- 2.39.2