aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/tuiterm.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-09-15 17:24:26 -0600
committerTom Tromey <tom@tromey.com>2023-09-29 10:55:43 -0600
commit4ebfd53de03599b73838ee339e47652ac26c37c0 (patch)
tree5990de5f860d32aa252dfb7564fbbb56179f737c /gdb/testsuite/lib/tuiterm.exp
parent2677a57064afd32076b85295bdc11de6e75e7e36 (diff)
downloadgdb-4ebfd53de03599b73838ee339e47652ac26c37c0.zip
gdb-4ebfd53de03599b73838ee339e47652ac26c37c0.tar.gz
gdb-4ebfd53de03599b73838ee339e47652ac26c37c0.tar.bz2
Support the NO_COLOR environment variable
I ran across this site: https://no-color.org/ ... which lobbies for tools to recognize the NO_COLOR environment variable and disable any terminal styling when it is seen. This patch implements this for gdb. Regression tested on x86-64 Fedora 38. Co-Authored-By: Andrew Burgess <aburgess@redhat.com> Reviewed-by: Kevin Buettner <kevinb@redhat.com> Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/testsuite/lib/tuiterm.exp')
-rw-r--r--gdb/testsuite/lib/tuiterm.exp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 598c1f8..854fde5 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -844,8 +844,9 @@ namespace eval Term {
# BODY.
proc with_tuiterm {rows cols body} {
global env stty_init
- save_vars {env(TERM) stty_init} {
+ save_vars {env(TERM) env(NO_COLOR) stty_init} {
setenv TERM ansi
+ setenv NO_COLOR ""
_setup $rows $cols
uplevel $body