@@ -922,6 +922,7 @@ endfunc
922922func Test_xx01_term_style_response ()
923923 " Termresponse is only parsed when t_RV is not empty.
924924 set t_RV = x
925+ call test_override (' term_props' , 1 )
925926
926927 " send the termresponse to trigger requesting the XT codes
927928 let seq = " \<Esc> [>41;337;0c"
@@ -932,7 +933,15 @@ func Test_xx01_term_style_response()
932933 call feedkeys (seq, ' Lx!' )
933934 call assert_equal (seq, v: termstyleresp )
934935
936+ call assert_equal (#{
937+ \ cursor_style: ' u' ,
938+ \ cursor_blink_mode: ' u' ,
939+ \ underline_rgb: ' u' ,
940+ \ mouse : ' s'
941+ \ }, terminalprops ())
942+
935943 set t_RV =
944+ call test_override (' term_props' , 0 )
936945endfunc
937946
938947" This checks the iTerm2 version response.
@@ -941,6 +950,7 @@ endfunc
941950func Test_xx02_iTerm2_response ()
942951 " Termresponse is only parsed when t_RV is not empty.
943952 set t_RV = x
953+ call test_override (' term_props' , 1 )
944954
945955 " Old versions of iTerm2 used a different style term response.
946956 set ttymouse = xterm
@@ -957,7 +967,15 @@ func Test_xx02_iTerm2_response()
957967 call assert_equal (seq, v: termresponse )
958968 call assert_equal (' sgr' , &ttymouse )
959969
970+ call assert_equal (#{
971+ \ cursor_style: ' n' ,
972+ \ cursor_blink_mode: ' u' ,
973+ \ underline_rgb: ' u' ,
974+ \ mouse : ' s'
975+ \ }, terminalprops ())
976+
960977 set t_RV =
978+ call test_override (' term_props' , 0 )
961979endfunc
962980
963981" This checks the libvterm version response.
@@ -966,6 +984,7 @@ endfunc
966984func Test_xx03_libvterm_response ()
967985 " Termresponse is only parsed when t_RV is not empty.
968986 set t_RV = x
987+ call test_override (' term_props' , 1 )
969988
970989 set ttymouse = xterm
971990 call test_option_not_set (' ttymouse' )
@@ -974,7 +993,15 @@ func Test_xx03_libvterm_response()
974993 call assert_equal (seq, v: termresponse )
975994 call assert_equal (' sgr' , &ttymouse )
976995
996+ call assert_equal (#{
997+ \ cursor_style: ' n' ,
998+ \ cursor_blink_mode: ' u' ,
999+ \ underline_rgb: ' u' ,
1000+ \ mouse : ' s'
1001+ \ }, terminalprops ())
1002+
9771003 set t_RV =
1004+ call test_override (' term_props' , 0 )
9781005endfunc
9791006
9801007" This checks the Mac Terminal.app version response.
@@ -983,6 +1010,7 @@ endfunc
9831010func Test_xx04_Mac_Terminal_response ()
9841011 " Termresponse is only parsed when t_RV is not empty.
9851012 set t_RV = x
1013+ call test_override (' term_props' , 1 )
9861014
9871015 set ttymouse = xterm
9881016 call test_option_not_set (' ttymouse' )
@@ -991,10 +1019,18 @@ func Test_xx04_Mac_Terminal_response()
9911019 call assert_equal (seq, v: termresponse )
9921020 call assert_equal (' sgr' , &ttymouse )
9931021
1022+ call assert_equal (#{
1023+ \ cursor_style: ' n' ,
1024+ \ cursor_blink_mode: ' u' ,
1025+ \ underline_rgb: ' y' ,
1026+ \ mouse : ' s'
1027+ \ }, terminalprops ())
1028+
9941029 " Reset is_not_xterm and is_mac_terminal.
9951030 set t_RV =
9961031 set term = xterm
9971032 set t_RV = x
1033+ call test_override (' term_props' , 0 )
9981034endfunc
9991035
10001036" This checks the mintty version response.
@@ -1003,6 +1039,7 @@ endfunc
10031039func Test_xx05_mintty_response ()
10041040 " Termresponse is only parsed when t_RV is not empty.
10051041 set t_RV = x
1042+ call test_override (' term_props' , 1 )
10061043
10071044 set ttymouse = xterm
10081045 call test_option_not_set (' ttymouse' )
@@ -1011,7 +1048,15 @@ func Test_xx05_mintty_response()
10111048 call assert_equal (seq, v: termresponse )
10121049 call assert_equal (' sgr' , &ttymouse )
10131050
1051+ call assert_equal (#{
1052+ \ cursor_style: ' n' ,
1053+ \ cursor_blink_mode: ' u' ,
1054+ \ underline_rgb: ' y' ,
1055+ \ mouse : ' s'
1056+ \ }, terminalprops ())
1057+
10141058 set t_RV =
1059+ call test_override (' term_props' , 0 )
10151060endfunc
10161061
10171062" This checks the screen version response.
@@ -1020,6 +1065,7 @@ endfunc
10201065func Test_xx06_screen_response ()
10211066 " Termresponse is only parsed when t_RV is not empty.
10221067 set t_RV = x
1068+ call test_override (' term_props' , 1 )
10231069
10241070 " Old versions of screen don't support SGR mouse mode.
10251071 set ttymouse = xterm
@@ -1037,7 +1083,15 @@ func Test_xx06_screen_response()
10371083 call assert_equal (seq, v: termresponse )
10381084 call assert_equal (' sgr' , &ttymouse )
10391085
1086+ call assert_equal (#{
1087+ \ cursor_style: ' n' ,
1088+ \ cursor_blink_mode: ' n' ,
1089+ \ underline_rgb: ' y' ,
1090+ \ mouse : ' s'
1091+ \ }, terminalprops ())
1092+
10401093 set t_RV =
1094+ call test_override (' term_props' , 0 )
10411095endfunc
10421096
10431097" This checks the xterm version response.
@@ -1046,6 +1100,7 @@ endfunc
10461100func Test_xx07_xterm_response ()
10471101 " Termresponse is only parsed when t_RV is not empty.
10481102 set t_RV = x
1103+ call test_override (' term_props' , 1 )
10491104
10501105 " Do Terminal.app first to check that is_mac_terminal is reset.
10511106 set ttymouse = xterm
@@ -1066,6 +1121,13 @@ func Test_xx07_xterm_response()
10661121 call assert_equal (seq, v: termresponse )
10671122 call assert_equal (' xterm' , &ttymouse )
10681123
1124+ call assert_equal (#{
1125+ \ cursor_style: ' n' ,
1126+ \ cursor_blink_mode: ' u' ,
1127+ \ underline_rgb: ' y' ,
1128+ \ mouse : ' u'
1129+ \ }, terminalprops ())
1130+
10691131 " xterm >= 95 < 277 "xterm2"
10701132 set ttymouse = xterm
10711133 call test_option_not_set (' ttymouse' )
@@ -1074,6 +1136,13 @@ func Test_xx07_xterm_response()
10741136 call assert_equal (seq, v: termresponse )
10751137 call assert_equal (' xterm2' , &ttymouse )
10761138
1139+ call assert_equal (#{
1140+ \ cursor_style: ' n' ,
1141+ \ cursor_blink_mode: ' u' ,
1142+ \ underline_rgb: ' u' ,
1143+ \ mouse : ' 2'
1144+ \ }, terminalprops ())
1145+
10771146 " xterm >= 277: "sgr"
10781147 set ttymouse = xterm
10791148 call test_option_not_set (' ttymouse' )
@@ -1082,7 +1151,30 @@ func Test_xx07_xterm_response()
10821151 call assert_equal (seq, v: termresponse )
10831152 call assert_equal (' sgr' , &ttymouse )
10841153
1154+ call assert_equal (#{
1155+ \ cursor_style: ' n' ,
1156+ \ cursor_blink_mode: ' u' ,
1157+ \ underline_rgb: ' u' ,
1158+ \ mouse : ' s'
1159+ \ }, terminalprops ())
1160+
1161+ " xterm >= 279: "sgr" and cursor_style not reset
1162+ set ttymouse = xterm
1163+ call test_option_not_set (' ttymouse' )
1164+ let seq = " \<Esc> [>0;279;0c"
1165+ call feedkeys (seq, ' Lx!' )
1166+ call assert_equal (seq, v: termresponse )
1167+ call assert_equal (' sgr' , &ttymouse )
1168+
1169+ call assert_equal (#{
1170+ \ cursor_style: ' u' ,
1171+ \ cursor_blink_mode: ' u' ,
1172+ \ underline_rgb: ' u' ,
1173+ \ mouse : ' s'
1174+ \ }, terminalprops ())
1175+
10851176 set t_RV =
1177+ call test_override (' term_props' , 0 )
10861178endfunc
10871179
10881180func Test_get_termcode ()
0 commit comments