From 56b51448d39b751e41edcb51904060a2dc3765fc Mon Sep 17 00:00:00 2001 From: sitiom Date: Sun, 24 Sep 2023 21:32:44 +0800 Subject: [PATCH] Detect WT_SESSION and TERM_PROGRAM environment variables --- ipcalc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipcalc b/ipcalc index 803694a..0a4e614 100755 --- a/ipcalc +++ b/ipcalc @@ -742,7 +742,7 @@ sub getopts # Under Emacs, do not use colors by default. The TERM is for older # Emacs versions. - if ( !defined($ENV{'TERM'}) or $ENV{'TERM'} =~ /dumb/i or $ENV{'INSIDE_EMACS'} ) { + if ( !defined($ENV{'WT_SESSION'}) and !defined($ENV{'TERM'}) and !defined($ENV{'TERM_PROGRAM'}) or defined($ENV{'TERM'}) and $ENV{'TERM'} =~ /dumb/i or $ENV{'INSIDE_EMACS'} ) { $opt_color = 0; }