jp: fix background guessing when stdin is redirected
This commit is contained in:
parent
80ee158daa
commit
9442835ddb
1 changed files with 2 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ class LiberviaCli:
|
||||||
return config.getConfig(self.sat_conf, section, name, default=default)
|
return config.getConfig(self.sat_conf, section, name, default=default)
|
||||||
|
|
||||||
def guess_background(self):
|
def guess_background(self):
|
||||||
if not sys.stdout.isatty():
|
if not sys.stdin.isatty() or not sys.stdout.isatty():
|
||||||
return 'dark'
|
return 'dark'
|
||||||
stdin_fd = sys.stdin.fileno()
|
stdin_fd = sys.stdin.fileno()
|
||||||
old_settings = termios.tcgetattr(stdin_fd)
|
old_settings = termios.tcgetattr(stdin_fd)
|
||||||
|
|
@ -155,7 +155,7 @@ class LiberviaCli:
|
||||||
if background not in ('dark', 'light'):
|
if background not in ('dark', 'light'):
|
||||||
raise exceptions.ConfigError(_(
|
raise exceptions.ConfigError(_(
|
||||||
f'Invalid value set for "background" ({background!r}), please check '
|
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':
|
if background == 'light':
|
||||||
C.A_HEADER = A.FG_MAGENTA
|
C.A_HEADER = A.FG_MAGENTA
|
||||||
C.A_SUBHEADER = A.BOLD + A.FG_RED
|
C.A_SUBHEADER = A.BOLD + A.FG_RED
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue