diff options
author | Tom de Vries <tdevries@suse.de> | 2025-04-07 22:27:39 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-04-07 22:27:39 +0200 |
commit | 907c06d0e4eb0bb9b7eb712d7d1018836bb52cc4 (patch) | |
tree | 79003a7015968df746ea835fb1f5b944b4eeac78 /gdb/testsuite/gdb.python/py-source-styling-2.c | |
parent | 2707d55e539ef323dd14a1293e762bf3d9739ee7 (diff) | |
download | binutils-907c06d0e4eb0bb9b7eb712d7d1018836bb52cc4.zip binutils-907c06d0e4eb0bb9b7eb712d7d1018836bb52cc4.tar.gz binutils-907c06d0e4eb0bb9b7eb712d7d1018836bb52cc4.tar.bz2 |
[gdb/tui] Don't try deferred curses initialization twice
I noticed that if deferred curses initialization fails, for instance when
using TERM=dumb, and we try the same again, we run into the same error:
...
$ TERM=dumb gdb -batch -ex "tui enable" -ex "tui enable"
Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb]
Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb]
...
I think it's better to try deferred curses initialization only once.
Fix this by changing bool tui_finish_init into a tribool, and using
TRIBOOL_UNKNOWN to represent the "initialization failed" state, such that we
get instead:
...
$ TERM=dumb gdb -batch -ex "tui enable" -ex "tui enable"
Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb]
Cannot enable the TUI
...
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite/gdb.python/py-source-styling-2.c')
0 files changed, 0 insertions, 0 deletions