summaryrefslogtreecommitdiffstats
path: root/pym/output.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-11 08:43:56 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-11 08:43:56 +0000
commit82060309435411750a0967891dd9510c4d138b13 (patch)
treeaab3fab7e5ecae73b7982da92034b4735707aad6 /pym/output.py
parentc69b0f404b40e56e05c9ab443353cb7332c61183 (diff)
downloadportage-82060309435411750a0967891dd9510c4d138b13.tar.gz
portage-82060309435411750a0967891dd9510c4d138b13.tar.bz2
portage-82060309435411750a0967891dd9510c4d138b13.zip
For consistency with other xterm titles code, redirect $PROMPT_COMMAND output to stderr. (trunk r6799)
svn path=/main/branches/2.1.2/; revision=6800
Diffstat (limited to 'pym/output.py')
-rw-r--r--pym/output.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/output.py b/pym/output.py
index ca265124a..6886e5cbb 100644
--- a/pym/output.py
+++ b/pym/output.py
@@ -196,7 +196,16 @@ def xtermTitleReset():
default_xterm_title = ""
elif prompt_command is not None:
if dotitles and "TERM" in os.environ and sys.stderr.isatty():
- os.system(prompt_command)
+ from portage_exec import find_binary, spawn
+ shell = os.environ.get("SHELL")
+ if not shell or not os.access(shell, os.EX_OK):
+ shell = find_binary("sh")
+ if shell:
+ spawn([shell, "-c", prompt_command], env=os.environ,
+ fdpipes={0:sys.stdin.fileno(),1:sys.stderr.fileno(),
+ 2:sys.stderr.fileno()})
+ else:
+ os.system(prompt_command)
return
else:
pwd = os.getenv('PWD','')