comparison src/testdir/test_termcodes.vim @ 18360:e460e6878406 v8.1.2174

patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes Commit: https://github.com/vim/vim/commit/89577b3b3e559d6ed8467b8e756f86f9f9607cae Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 18 21:26:05 2019 +0200 patch 8.1.2174: screen not recognized as supporting "sgr" mouse codes Problem: Screen not recognized as supporting "sgr" mouse codes. Solution: Recognize screen 4.7. (Jordan Christiansen, closes https://github.com/vim/vim/issues/5042)
author Bram Moolenaar <Bram@vim.org>
date Fri, 18 Oct 2019 21:30:03 +0200
parents b1796f1b28fa
children 169c810d4e51
comparison
equal deleted inserted replaced
18359:364d4a970edc 18360:e460e6878406
880 call assert_equal(seq, v:termstyleresp) 880 call assert_equal(seq, v:termstyleresp)
881 881
882 set t_RV= 882 set t_RV=
883 endfunc 883 endfunc
884 884
885 " This checks the iTerm2 version response.
886 " This must be after other tests, because it has side effects to xterm
887 " properties.
888 func Test_xx02_iTerm2_response()
889 " Termresponse is only parsed when t_RV is not empty.
890 set t_RV=x
891
892 " Old versions of iTerm2 used a different style term response.
893 set ttymouse=xterm
894 call test_option_not_set('ttymouse')
895 let seq = "\<Esc>[>0;95;c"
896 call feedkeys(seq, 'Lx!')
897 call assert_equal(seq, v:termresponse)
898 call assert_equal('xterm', &ttymouse)
899
900 set ttymouse=xterm
901 call test_option_not_set('ttymouse')
902 let seq = "\<Esc>[>0;95;0c"
903 call feedkeys(seq, 'Lx!')
904 call assert_equal(seq, v:termresponse)
905 call assert_equal('sgr', &ttymouse)
906
907 set t_RV=
908 endfunc
909
885 " This checks the libvterm version response. 910 " This checks the libvterm version response.
886 " This must be after other tests, because it has side effects to xterm 911 " This must be after other tests, because it has side effects to xterm
887 " properties. 912 " properties.
888 func Test_xx02_libvterm_response() 913 func Test_xx03_libvterm_response()
889 " Termresponse is only parsed when t_RV is not empty. 914 " Termresponse is only parsed when t_RV is not empty.
890 set t_RV=x 915 set t_RV=x
891 916
892 set ttymouse=xterm 917 set ttymouse=xterm
893 call test_option_not_set('ttymouse') 918 call test_option_not_set('ttymouse')
897 call assert_equal('sgr', &ttymouse) 922 call assert_equal('sgr', &ttymouse)
898 923
899 set t_RV= 924 set t_RV=
900 endfunc 925 endfunc
901 926
927 " This checks the Mac Terminal.app version response.
928 " This must be after other tests, because it has side effects to xterm
929 " properties.
930 func Test_xx04_Mac_Terminal_response()
931 " Termresponse is only parsed when t_RV is not empty.
932 set t_RV=x
933
934 set ttymouse=xterm
935 call test_option_not_set('ttymouse')
936 let seq = "\<Esc>[>1;95;0c"
937 call feedkeys(seq, 'Lx!')
938 call assert_equal(seq, v:termresponse)
939 call assert_equal('sgr', &ttymouse)
940
941 " Reset is_not_xterm and is_mac_terminal.
942 set t_RV=
943 set term=xterm
944 set t_RV=x
945 endfunc
946
947 " This checks the mintty version response.
948 " This must be after other tests, because it has side effects to xterm
949 " properties.
950 func Test_xx05_mintty_response()
951 " Termresponse is only parsed when t_RV is not empty.
952 set t_RV=x
953
954 set ttymouse=xterm
955 call test_option_not_set('ttymouse')
956 let seq = "\<Esc>[>77;20905;0c"
957 call feedkeys(seq, 'Lx!')
958 call assert_equal(seq, v:termresponse)
959 call assert_equal('sgr', &ttymouse)
960
961 set t_RV=
962 endfunc
963
964 " This checks the screen version response.
965 " This must be after other tests, because it has side effects to xterm
966 " properties.
967 func Test_xx06_screen_response()
968 " Termresponse is only parsed when t_RV is not empty.
969 set t_RV=x
970
971 " Old versions of screen don't support SGR mouse mode.
972 set ttymouse=xterm
973 call test_option_not_set('ttymouse')
974 let seq = "\<Esc>[>83;40500;0c"
975 call feedkeys(seq, 'Lx!')
976 call assert_equal(seq, v:termresponse)
977 call assert_equal('xterm', &ttymouse)
978
979 " screen supports SGR mouse mode starting in version 4.7.
980 set ttymouse=xterm
981 call test_option_not_set('ttymouse')
982 let seq = "\<Esc>[>83;40700;0c"
983 call feedkeys(seq, 'Lx!')
984 call assert_equal(seq, v:termresponse)
985 call assert_equal('sgr', &ttymouse)
986
987 set t_RV=
988 endfunc
989
902 " This checks the xterm version response. 990 " This checks the xterm version response.
903 " This must be after other tests, because it has side effects to xterm 991 " This must be after other tests, because it has side effects to xterm
904 " properties. 992 " properties.
905 func Test_xx03_xterm_response() 993 func Test_xx07_xterm_response()
906 " Termresponse is only parsed when t_RV is not empty. 994 " Termresponse is only parsed when t_RV is not empty.
907 set t_RV=x 995 set t_RV=x
908 996
909 " Do Terminal.app first to check that is_mac_terminal is reset. 997 " Do Terminal.app first to check that is_mac_terminal is reset.
910 set ttymouse=xterm 998 set ttymouse=xterm
941 call assert_equal(seq, v:termresponse) 1029 call assert_equal(seq, v:termresponse)
942 call assert_equal('sgr', &ttymouse) 1030 call assert_equal('sgr', &ttymouse)
943 1031
944 set t_RV= 1032 set t_RV=
945 endfunc 1033 endfunc
946
947 " TODO: check other terminals response
948 1034
949 func Test_get_termcode() 1035 func Test_get_termcode()
950 try 1036 try
951 let k1 = &t_k1 1037 let k1 = &t_k1
952 catch /E113/ 1038 catch /E113/