changeset 3547:1ac5570fa998

jp: fix background guessing when stdin is redirected
author Goffi <goffi@goffi.org>
date Fri, 04 Jun 2021 15:23:24 +0200
parents 185601bc0cd3
children 13e7ef106589
files sat_frontends/jp/base.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Fri Jun 04 14:44:33 2021 +0200
+++ b/sat_frontends/jp/base.py	Fri Jun 04 15:23:24 2021 +0200
@@ -120,7 +120,7 @@
         return config.getConfig(self.sat_conf, section, name, default=default)
 
     def guess_background(self):
-        if not sys.stdout.isatty():
+        if not sys.stdin.isatty() or not sys.stdout.isatty():
             return 'dark'
         stdin_fd = sys.stdin.fileno()
         old_settings = termios.tcgetattr(stdin_fd)
@@ -155,7 +155,7 @@
         if background not in ('dark', 'light'):
             raise exceptions.ConfigError(_(
                 f'Invalid value set for "background" ({background!r}), please check '
-                f'your settings in sat.conf'))
+                f'your settings in libervia.conf'))
         if background == 'light':
             C.A_HEADER = A.FG_MAGENTA
             C.A_SUBHEADER = A.BOLD + A.FG_RED