From 0dceeb00d914fed4bed90d1e379bce0fdc5ea1d8 Mon Sep 17 00:00:00 2001 From: adam j hartz Date: Sun, 6 Mar 2016 15:34:50 -0500 Subject: [PATCH] modify when title is set to avoid capturing it --- xonsh/base_shell.py | 3 +-- xonsh/built_ins.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xonsh/base_shell.py b/xonsh/base_shell.py index da7ef1a88..c6e94eeb1 100644 --- a/xonsh/base_shell.py +++ b/xonsh/base_shell.py @@ -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): diff --git a/xonsh/built_ins.py b/xonsh/built_ins.py index c554298c4..1f722e253 100644 --- a/xonsh/built_ins.py +++ b/xonsh/built_ins.py @@ -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()