modify when title is set to avoid capturing it

This commit is contained in:
adam j hartz 2016-03-06 15:34:50 -05:00
parent f4e9fc6bbe
commit 0dceeb00d9
2 changed files with 2 additions and 3 deletions

View file

@ -216,8 +216,7 @@ class BaseShell(object):
t = escape_windows_title_string(t)
os.system('title {}'.format(t))
else:
sys.stdout.write("\x1b]2;{0}\x07".format(t))
sys.stdout.flush()
os.write(1, "\x1b]2;{0}\x07".format(t).encode())
@property
def prompt(self):

View file

@ -617,7 +617,7 @@ def run_subproc(cmds, captured=False):
'obj': prev_proc,
'bg': background
})
if ENV.get('XONSH_INTERACTIVE') and not ENV.get('XONSH_STORE_STDOUT'):
if ENV.get('XONSH_INTERACTIVE') and not ENV.get('XONSH_STORE_STDOUT') and captured is False:
# set title here to get current command running
try:
builtins.__xonsh_shell__.settitle()