When calling Term::_csi_m with no args, default behaviour needs to be applied,
which is equivalent to "Term::_csi_m 0" [1].
However, while "Term::_csi_m 0" works, as well as 'Term::_csi_m ""', calling
Term::_csi_m with no args has no effect.
Fix this by implementing the default behaviour in Term::_csi_m.
Tested on aarch64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
[1] https://vt100.net/docs/vt510-rm/SGR.html
set line [Term::get_line_with_attrs 0]
gdb_assert { [regexp $re $line] } "attribute: $attr"
}
+
+ # Regression test: Check that _csi_m works without arguments.
+ setup_terminal 4 1
+ Term::_csi_m 7
+ Term::_insert "a"
+ Term::_csi_m
+ Term::_insert "a"
+ set line [Term::get_line_with_attrs 0]
+ gdb_assert { [string equal $line "<reverse:1>a<reverse:0>a "] }
}
# Run proc TEST_PROC_NAME with a "small" terminal.
#
# https://vt100.net/docs/vt510-rm/SGR.html
proc _csi_m {args} {
+ if { [llength $args] == 0 } {
+ # Apply default.
+ set args [list 0]
+ }
+
_log_cur "Select Graphic Rendition ([join $args {, }])" {
variable _attrs