diff options
-rw-r--r-- | cerbero/config.py | 2 | ||||
-rw-r--r-- | cerbero/utils/shell.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/cerbero/config.py b/cerbero/config.py index 75574c67..8a8f1ed8 100644 --- a/cerbero/config.py +++ b/cerbero/config.py @@ -396,7 +396,7 @@ class Config (object): self.set_property('recipes_remotes', {}) self.set_property('extra_build_tools', []) self.set_property('distro_packages_install', True) - self.set_property('interactive', True) + self.set_property('interactive', shell.console_is_interactive()) self.set_property('meson_cross_properties', {}) self.set_property('manifest', None) self.set_property('extra_properties', {}) diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index 5f67d983..36563f18 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -102,6 +102,13 @@ class StdOut: def __getattr__(self, attr): return getattr(self.stream, attr) +def console_is_interactive(): + if not os.isatty(sys.stdout.fileno()): + return False + if os.environ.get('TERM') == 'dumb': + return False + return True + def _fix_mingw_cmd(path): reserved = ['/', ' ', '\\', ')', '(', '"'] |