[6/6,gdb/testsuite] Use ansi-for-tui in tuiterm

Message ID 20230522131545.12291-8-tdevries@suse.de
State New
Headers
Series Introduce ansi-for-tui |

Commit Message

Tom de Vries May 22, 2023, 1:15 p.m. UTC
  Use terminfo entry ansi-for-tui instead of ansi in tuiterm.

In contrast to the ansi entry, the ansi-for-tui entry has the xenl capability
set, so set _newline_glitch to 1 to make sure tuiterm matches the newly
advertised behaviour.

Also the new entry makes tui border-kind acs a copy of tui border-kind ascii,
which allows us to remove this from prepare_for_tui:
...
   gdb_test_no_output "set tui border-kind ascii"
...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.tui/wrap-line.exp | 4 ++--
 gdb/testsuite/lib/tuiterm.exp       | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp
index 4587517504c..82e3167a210 100644
--- a/gdb/testsuite/gdb.tui/wrap-line.exp
+++ b/gdb/testsuite/gdb.tui/wrap-line.exp
@@ -93,8 +93,8 @@  proc test_wrap_cli_tui { auto_detected_width } {
 
     gdb_assert { $gdb_width == $::cols } "width"
 
-    # TERM=ansi, so readline hides the last column.
-    gdb_assert { $gdb_width == [expr $readline_width + 1] }
+    # TERM=ansi-for-tui, so readline doesn't hide the last column.
+    gdb_assert { $gdb_width == $readline_width }
 
     with_test_prefix cli {
 	set wrap_width $readline_width
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index bb0681f2034..0024cd85ee7 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -770,7 +770,7 @@  namespace eval Term {
 	set _cur_col 0
 	set _cur_row 0
 	set _resize_count 0
-	set _newline_glitch 0
+	set _newline_glitch 1
 	_reset_attrs _attrs
 
 	_clear_lines 0 $_rows
@@ -901,7 +901,7 @@  namespace eval Term {
 
 	save_vars {env(TERM) env(TERMINFO) stty_init} {
 	    setenv TERMINFO $terminfo
-	    setenv TERM ansi
+	    setenv TERM ansi-for-tui
 	    _setup $rows $cols
 
 	    uplevel $body
@@ -946,7 +946,6 @@  namespace eval Term {
 	    return 0
 	}
 
-	gdb_test_no_output "set tui border-kind ascii"
 	gdb_test_no_output "maint set tui-resize-message on"
 	return 1
     }