diff sat_frontends/jp/base.py @ 3378:67e306cae157

jp: don't guess background when stdout is not a tty
author Goffi <goffi@goffi.org>
date Thu, 15 Oct 2020 14:44:42 +0200
parents 9d0df638c8b4
children 2f0be2b7de68
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Thu Oct 01 10:12:01 2020 +0200
+++ b/sat_frontends/jp/base.py	Thu Oct 15 14:44:42 2020 +0200
@@ -120,6 +120,8 @@
         return config.getConfig(self.sat_conf, section, name, default=default)
 
     def guess_background(self):
+        if not sys.stdout.isatty():
+            return 'dark'
         stdin_fd = sys.stdin.fileno()
         old_settings = termios.tcgetattr(stdin_fd)
         try: