[PATCH 3/5] Preserve FANCYTTY after log_use_fancy_output calls

Trek trek00 at inbox.ru
Tue Apr 26 22:48:16 BST 2022


This allows scripts to redirect some of their output, without
getting the fancy output disabled in subsequent calls of the
logging functions and without the need to restore FANCYTTY to
its original value.
---
 init-functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init-functions b/init-functions
index cd584d0..1c5219e 100644
--- a/init-functions
+++ b/init-functions
@@ -214,9 +214,9 @@ log_use_fancy_output () {
 	[ "x${TERM:-}" != "x" ] &&
 	[ "x${TERM:-}" != "xdumb" ]
     then
-        [ -z $FANCYTTY ] && FANCYTTY=1 || true
+        [ -z $FANCYTTY ] && return 0 || true
     else
-        FANCYTTY=0
+        return 1
     fi
     case "$FANCYTTY" in
         1|Y|yes|true)   true;;
-- 
2.20.1



More information about the Debian-init-diversity mailing list