I noticed in proc Term::_csi_m arguments that while parameters 7 and 27 are
supposed to set the reverse attribute to 1 and 0, in fact it's set to 1 in
both cases:
...
7 {
set _attrs(reverse) 1
}
...
27 {
set _attrs(reverse) 1
}
...
Fix this and add a regression test in gdb.tui/tuiterm.exp.
Tested on x86_64-linux.
} 2 0
}
+proc test_attrs {} {
+ foreach { attr vals } {
+ reverse {
+ 7 1
+ 27 0
+ }
+ underline {
+ 4 1
+ 24 0
+ }
+ intensity {
+ 1 bold
+ 2 dim
+ 22 normal
+ }
+ } {
+ setup_terminal 8 1
+ set re ""
+ foreach { arg val } $vals {
+ Term::_insert "a"
+ Term::_csi_m $arg
+ append re "a<$attr:$val>"
+ }
+
+ Term::_insert "a"
+ append re "a"
+
+ set re "^$re *$"
+
+ set line [Term::get_line_with_attrs 0]
+ gdb_assert { [regexp $re $line] } "attribute: $attr"
+ }
+}
+
# Run proc TEST_PROC_NAME with a "small" terminal.
proc run_one_test_small { test_proc_name } {
} {
run_one_test_large $test
}
+
+test_attrs
set _attrs(underline) 0
}
27 {
- set _attrs(reverse) 1
+ set _attrs(reverse) 0
}
30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 {
set _attrs(fg) $item