From 0b54862188a50d5b757d69d96643ec20c76b0c07 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 10 Jun 2016 17:42:39 +0100 Subject: [PATCH] dot/bashrc: Do check for SCHROOT_SESSION_ID when defining setprompt, rather than when executing it This is OK because SCHROOT_SESSION_ID does not change during the life of the shell. (And setprompt is redefined in each new shell, not exported.) --- dot/bashrc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dot/bashrc b/dot/bashrc index a173c4b..ab1b5d3 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -11,11 +11,13 @@ export PWD # My own functions ls() { /bin/ls -FC "$@"; } ll() { /bin/ls -FCla "$@"; } -setprompt() { - if [ "x$SCHROOT_SESSION_ID" = x ]; then - PS1=`autotitle`; export PS1; - fi - } + +if [ "x$SCHROOT_SESSION_ID" = x ]; then + setprompt() { PS1=`autotitle`; export PS1; } +else + setprompt() { :; } +fi + rs() { eval `/usr/openwin/bin/resize` ; setprompt ; } cd() { builtin cd "$@"; setprompt; } pu() { builtin pushd "$@"; setprompt; } -- 2.30.2