chiark / gitweb /
dot/bashrc: Do check for SCHROOT_SESSION_ID when defining setprompt, rather than...
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 10 Jun 2016 16:42:39 +0000 (17:42 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 10 Jun 2016 17:04:23 +0000 (18:04 +0100)
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

index a173c4b6fb8ac8b9a989e4e4d2db02fc153fa410..ab1b5d354abbc69e54b50d6beb8ae036e535423e 100644 (file)
@@ -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; }