From ee75421fb5ca715db48b3ff2c8eeb3f1fc773180 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 23 Feb 2016 02:59:29 +0300 Subject: [PATCH] .shellrc: save/reset/restore OPS1 for mc --- .shellrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.shellrc b/.shellrc index 124aef1..acb5c52 100644 --- a/.shellrc +++ b/.shellrc @@ -138,6 +138,13 @@ include() mc() { + case "$SHELL" in + */bash) + MC_SAVE_OPS1="$OPS1" + OPS1="\u@\h " + ;; + esac + if [ -n "$SLOWTERM" ]; then MC_SLOW="--slow" fi @@ -198,8 +205,11 @@ mc() { rc=1 fi + [ -n "$MC_SAVE_OPS1" ] && OPS1="$MC_SAVE_OPS1" [ -n "$MC_SAVE_TERM" ] && TERM="$MC_SAVE_TERM" - unset MC_FOUND MC_PWD_FILE MC_SAVE_TERM MC_SLOW MC_TMP_DIR MC_XTERM + unset MC_FOUND MC_PWD_FILE MC_SAVE_OPS1 MC_SAVE_TERM \ + MC_SLOW MC_TMP_DIR MC_XTERM + return $rc } -- 2.39.5