]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Handle Horizontal Position Absolute in tuiterm
authorTom de Vries <tdevries@suse.de>
Wed, 23 Jul 2025 18:28:46 +0000 (20:28 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 23 Jul 2025 18:28:46 +0000 (20:28 +0200)
I ran the tui testsuite on freebsd with TERM=ansiw, and investigated the first
failure, in test-case gdb.tui/tui-init-source.exp.

The problem turned out to be the lack of handling a Horizontal Position
Absolute [1] sequence "^[[80`" in tuiterm.

Add Term::_csi_`, forwarding to Term::_csi_G which handles Cursor Horizontal
Absolute [2].

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
[1] https://vt100.net/docs/vt510-rm/HPA.html
[2] https://vt100.net/docs/vt510-rm/CHA.html

gdb/testsuite/gdb.tui/tuiterm.exp
gdb/testsuite/lib/tuiterm.exp

index fff7c37a56e492339d01919790fc4a7f7b3b4329..0e03bfaa8ea46600f81a798422599b7c53e2bde3 100644 (file)
@@ -451,6 +451,14 @@ proc test_horizontal_absolute { } {
        "qrstuvwx"
        "yz01234 "
     } 7 2
+
+    Term::_csi_`
+    check "horizontal position absolute 1" {
+       "abcdefgh"
+       "ijklmnop"
+       "qrstuvwx"
+       "yz01234 "
+    } 0 2
 }
 
 proc test_cursor_position { } {
index 71ef6a4eacd9d0928fd5f554306fec5c493e3863..2268b1e28e0c3fc452d89b53a1969e309cc7a4c6 100644 (file)
@@ -155,6 +155,14 @@ namespace eval Term {
        }
     }
 
+    # Horizontal Position Absolute.
+    #
+    # https://vt100.net/docs/vt510-rm/HPA.html
+    proc _csi_` {args} {
+       # Same as Cursor Horizontal Absolute.
+       return [Term::_csi_G {*}$args]
+    }
+
     # Cursor Up.
     #
     # https://vt100.net/docs/vt510-rm/CUU.html
@@ -740,7 +748,7 @@ namespace eval Term {
                _log "wait_for: unsupported escape"
                error "unsupported escape"
            }
-           -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@\])" {
+           -re "^\x1b\\\[(\[0-9;\]*)(\[a-zA-Z@`\])" {
                set cmd $expect_out(2,string)
                set params [split $expect_out(1,string) ";"]
                _log "wait_for: _csi_$cmd <<<$expect_out(1,string)>>>"