From 6f0e5db8ff50dbe8c32982dd57db374b2b679d1d Mon Sep 17 00:00:00 2001 From: ajohns Date: Fri, 18 Oct 2019 08:54:03 +1100 Subject: [PATCH] -use shell-specific version of REZ_STORED_PROMPT envvar --- src/rez/plugin_managers.py | 2 ++ src/rezplugins/shell/cmd.py | 4 ++-- src/rezplugins/shell/csh.py | 4 ++-- src/rezplugins/shell/sh.py | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/rez/plugin_managers.py b/src/rez/plugin_managers.py index c10faf32b..5f9b4985e 100644 --- a/src/rez/plugin_managers.py +++ b/src/rez/plugin_managers.py @@ -116,6 +116,8 @@ def load_plugins(self): paths = reversed(paths) for path in paths: + print_debug("searching plugin path %s...", path) + for loader, modname, ispkg in pkgutil.iter_modules( [path], package.__name__ + '.'): diff --git a/src/rezplugins/shell/cmd.py b/src/rezplugins/shell/cmd.py index e22946ec9..e9cfeac6c 100644 --- a/src/rezplugins/shell/cmd.py +++ b/src/rezplugins/shell/cmd.py @@ -137,10 +137,10 @@ def gen_expected_regex(parts): def _bind_interactive_rez(self): if config.set_prompt and self.settings.prompt: - stored_prompt = os.getenv("REZ_STORED_PROMPT") + stored_prompt = os.getenv("REZ_STORED_PROMPT_CMD") curr_prompt = stored_prompt or os.getenv("PROMPT", "") if not stored_prompt: - self.setenv("REZ_STORED_PROMPT", curr_prompt) + self.setenv("REZ_STORED_PROMPT_CMD", curr_prompt) new_prompt = "%%REZ_ENV_PROMPT%%" new_prompt = (new_prompt + " %s") if config.prefix_prompt \ diff --git a/src/rezplugins/shell/csh.py b/src/rezplugins/shell/csh.py index 0dfff2b03..3c72a6a6e 100644 --- a/src/rezplugins/shell/csh.py +++ b/src/rezplugins/shell/csh.py @@ -111,10 +111,10 @@ def escape_string(self, value): def _bind_interactive_rez(self): if config.set_prompt and self.settings.prompt: # TODO: Do more like in sh.py, much less error prone - stored_prompt = os.getenv("REZ_STORED_PROMPT") + stored_prompt = os.getenv("REZ_STORED_PROMPT_CSH") curr_prompt = stored_prompt or os.getenv("prompt", "[%m %c]%# ") if not stored_prompt: - self.setenv("REZ_STORED_PROMPT", '"%s"' % curr_prompt) + self.setenv("REZ_STORED_PROMPT_CSH", '"%s"' % curr_prompt) new_prompt = "$REZ_ENV_PROMPT" new_prompt = (new_prompt + " %s") if config.prefix_prompt \ diff --git a/src/rezplugins/shell/sh.py b/src/rezplugins/shell/sh.py index f71d4c72e..eb75799b1 100644 --- a/src/rezplugins/shell/sh.py +++ b/src/rezplugins/shell/sh.py @@ -92,11 +92,11 @@ def get_startup_sequence(cls, rcfile, norc, stdin, command): def _bind_interactive_rez(self): if config.set_prompt and self.settings.prompt: - self._addline(r'if [ -z "$REZ_STORED_PROMPT" ]; then export REZ_STORED_PROMPT="$PS1"; fi') + self._addline(r'if [ -z "$REZ_STORED_PROMPT_SH" ]; then export REZ_STORED_PROMPT_SH="$PS1"; fi') if config.prefix_prompt: - cmd = 'export PS1="%s $REZ_STORED_PROMPT"' + cmd = 'export PS1="%s $REZ_STORED_PROMPT_SH"' else: - cmd = 'export PS1="$REZ_STORED_PROMPT%s "' + cmd = 'export PS1="$REZ_STORED_PROMPT_SH %s"' self._addline(cmd % r"\[\e[1m\]$REZ_ENV_PROMPT\[\e[0m\]") def setenv(self, key, value):