Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 763 prompt leak #767

Merged
merged 2 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/rez/plugin_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ + '.'):

Expand Down
4 changes: 2 additions & 2 deletions src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions src/rezplugins/shell/csh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions src/rezplugins/shell/sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down