Download:
child 183:9119f0c58317
parent 181:9547811e4036
182:adcdefc73227
Anton Shestakov <av6@dwimlabs.net>, Thu, 11 Apr 2019 01:13:54 +0800
.bash_prompt: (re?)add debian_chroot support

2 файлов изменено, 7 вставок(+), 2 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
.bashrc file | annotate | diff | comparison | revisions
--- a/.bash_prompt Sat Mar 23 21:15:08 2019 +0800
+++ b/.bash_prompt Thu Apr 11 01:13:54 2019 +0800
@@ -57,11 +57,11 @@
fi
PS1="\
-${K}[${RESET}${TIME} \\u@\\h \
+${K}[${RESET}${TIME} ${debian_chroot:+${Y}(c)${RESET} }\\u@\\h \
${RETCODE}\\W${VENV}${HG_INFO}${GIT_INFO}${K}]${RESET}\
${PROMPT_COLOR}\\\$${RESET} "
- PS1="\\[\\033]0;\\u@\\h: \\W\\007\\]$PS1"
+ PS1="\\[\\033]0;${debian_chroot:+($debian_chroot) }\\u@\\h: \\W\\007\\]$PS1"
}
function _upsearch {
--- a/.bashrc Sat Mar 23 21:15:08 2019 +0800
+++ b/.bashrc Thu Apr 11 01:13:54 2019 +0800
@@ -24,6 +24,11 @@
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
+ debian_chroot=$(cat /etc/debian_chroot)
+fi
+
[ -x /usr/bin/keychain ] && eval "$(keychain --eval --quiet)"
if [ -x /usr/bin/dircolors ]; then