Mercurial > vim
comparison src/testdir/test_termcodes.vim @ 30958:122f883d7237 v9.0.0813
patch 9.0.0813: Kitty terminal is not recognized
Commit: https://github.com/vim/vim/commit/4bc85f23ed2cf1fab20597ff15cefa675ea5e2c6
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Oct 21 14:17:24 2022 +0100
patch 9.0.0813: Kitty terminal is not recognized
Problem: Kitty terminal is not recognized.
Solution: Recognize Kitty by the termresponse and then do not set
seenModifyOtherKeys, since Kitty doesn't support that.
(issue #11413)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Oct 2022 15:30:03 +0200 |
parents | 372b12480082 |
children | bcda60183c77 |
comparison
equal
deleted
inserted
replaced
30957:10e535aa2e65 | 30958:122f883d7237 |
---|---|
1645 | 1645 |
1646 call assert_equal(#{ | 1646 call assert_equal(#{ |
1647 \ cursor_style: 'u', | 1647 \ cursor_style: 'u', |
1648 \ cursor_blink_mode: 'u', | 1648 \ cursor_blink_mode: 'u', |
1649 \ underline_rgb: 'u', | 1649 \ underline_rgb: 'u', |
1650 \ mouse: 's' | 1650 \ mouse: 's', |
1651 \ kitty: 'u', | |
1651 \ }, terminalprops()) | 1652 \ }, terminalprops()) |
1652 | 1653 |
1653 set t_RV= | 1654 set t_RV= |
1654 call test_override('term_props', 0) | 1655 call test_override('term_props', 0) |
1655 endfunc | 1656 endfunc |
1679 | 1680 |
1680 call assert_equal(#{ | 1681 call assert_equal(#{ |
1681 \ cursor_style: 'n', | 1682 \ cursor_style: 'n', |
1682 \ cursor_blink_mode: 'u', | 1683 \ cursor_blink_mode: 'u', |
1683 \ underline_rgb: 'u', | 1684 \ underline_rgb: 'u', |
1684 \ mouse: 's' | 1685 \ mouse: 's', |
1686 \ kitty: 'u', | |
1685 \ }, terminalprops()) | 1687 \ }, terminalprops()) |
1686 | 1688 |
1687 set t_RV= | 1689 set t_RV= |
1688 call test_override('term_props', 0) | 1690 call test_override('term_props', 0) |
1689 endfunc | 1691 endfunc |
1698 | 1700 |
1699 call assert_equal(#{ | 1701 call assert_equal(#{ |
1700 \ cursor_style: 'n', | 1702 \ cursor_style: 'n', |
1701 \ cursor_blink_mode: 'u', | 1703 \ cursor_blink_mode: 'u', |
1702 \ underline_rgb: 'u', | 1704 \ underline_rgb: 'u', |
1703 \ mouse: 's' | 1705 \ mouse: 's', |
1706 \ kitty: 'u', | |
1704 \ }, terminalprops()) | 1707 \ }, terminalprops()) |
1705 endfunc | 1708 endfunc |
1706 | 1709 |
1707 " This checks the libvterm version response. | 1710 " This checks the libvterm version response. |
1708 " This must be after other tests, because it has side effects to xterm | 1711 " This must be after other tests, because it has side effects to xterm |
1740 | 1743 |
1741 call assert_equal(#{ | 1744 call assert_equal(#{ |
1742 \ cursor_style: 'n', | 1745 \ cursor_style: 'n', |
1743 \ cursor_blink_mode: 'u', | 1746 \ cursor_blink_mode: 'u', |
1744 \ underline_rgb: 'y', | 1747 \ underline_rgb: 'y', |
1745 \ mouse: 's' | 1748 \ mouse: 's', |
1749 \ kitty: 'u', | |
1746 \ }, terminalprops()) | 1750 \ }, terminalprops()) |
1747 call assert_equal("\<Esc>[58;2;%lu;%lu;%lum", &t_8u) | 1751 call assert_equal("\<Esc>[58;2;%lu;%lu;%lum", &t_8u) |
1748 | 1752 |
1749 " Reset is_not_xterm and is_mac_terminal. | 1753 " Reset is_not_xterm and is_mac_terminal. |
1750 set t_RV= | 1754 set t_RV= |
1770 | 1774 |
1771 call assert_equal(#{ | 1775 call assert_equal(#{ |
1772 \ cursor_style: 'n', | 1776 \ cursor_style: 'n', |
1773 \ cursor_blink_mode: 'u', | 1777 \ cursor_blink_mode: 'u', |
1774 \ underline_rgb: 'y', | 1778 \ underline_rgb: 'y', |
1775 \ mouse: 's' | 1779 \ mouse: 's', |
1780 \ kitty: 'u', | |
1776 \ }, terminalprops()) | 1781 \ }, terminalprops()) |
1777 | 1782 |
1778 set t_RV= | 1783 set t_RV= |
1779 call test_override('term_props', 0) | 1784 call test_override('term_props', 0) |
1780 endfunc | 1785 endfunc |
1805 | 1810 |
1806 call assert_equal(#{ | 1811 call assert_equal(#{ |
1807 \ cursor_style: 'n', | 1812 \ cursor_style: 'n', |
1808 \ cursor_blink_mode: 'n', | 1813 \ cursor_blink_mode: 'n', |
1809 \ underline_rgb: 'y', | 1814 \ underline_rgb: 'y', |
1810 \ mouse: 's' | 1815 \ mouse: 's', |
1816 \ kitty: 'u', | |
1811 \ }, terminalprops()) | 1817 \ }, terminalprops()) |
1812 | 1818 |
1813 set t_RV= | 1819 set t_RV= |
1814 call test_override('term_props', 0) | 1820 call test_override('term_props', 0) |
1815 endfunc | 1821 endfunc |
1829 | 1835 |
1830 call assert_equal(#{ | 1836 call assert_equal(#{ |
1831 \ cursor_style: 'u', | 1837 \ cursor_style: 'u', |
1832 \ cursor_blink_mode: 'u', | 1838 \ cursor_blink_mode: 'u', |
1833 \ underline_rgb: 'u', | 1839 \ underline_rgb: 'u', |
1834 \ mouse: 's' | 1840 \ mouse: 's', |
1841 \ kitty: 'u', | |
1835 \ }, terminalprops()) | 1842 \ }, terminalprops()) |
1836 call assert_equal(a:set_by_user ? default_value : '', &t_8u) | 1843 call assert_equal(a:set_by_user ? default_value : '', &t_8u) |
1837 endfunc | 1844 endfunc |
1838 | 1845 |
1839 " This checks the xterm version response. | 1846 " This checks the xterm version response. |
1865 | 1872 |
1866 call assert_equal(#{ | 1873 call assert_equal(#{ |
1867 \ cursor_style: 'n', | 1874 \ cursor_style: 'n', |
1868 \ cursor_blink_mode: 'u', | 1875 \ cursor_blink_mode: 'u', |
1869 \ underline_rgb: 'y', | 1876 \ underline_rgb: 'y', |
1870 \ mouse: 'u' | 1877 \ mouse: 'u', |
1878 \ kitty: 'u', | |
1871 \ }, terminalprops()) | 1879 \ }, terminalprops()) |
1872 | 1880 |
1873 " xterm >= 95 < 277 "xterm2" | 1881 " xterm >= 95 < 277 "xterm2" |
1874 set ttymouse=xterm | 1882 set ttymouse=xterm |
1875 call test_option_not_set('ttymouse') | 1883 call test_option_not_set('ttymouse') |
1880 | 1888 |
1881 call assert_equal(#{ | 1889 call assert_equal(#{ |
1882 \ cursor_style: 'n', | 1890 \ cursor_style: 'n', |
1883 \ cursor_blink_mode: 'u', | 1891 \ cursor_blink_mode: 'u', |
1884 \ underline_rgb: 'u', | 1892 \ underline_rgb: 'u', |
1885 \ mouse: '2' | 1893 \ mouse: '2', |
1894 \ kitty: 'u', | |
1886 \ }, terminalprops()) | 1895 \ }, terminalprops()) |
1887 | 1896 |
1888 " xterm >= 277: "sgr" | 1897 " xterm >= 277: "sgr" |
1889 set ttymouse=xterm | 1898 set ttymouse=xterm |
1890 call test_option_not_set('ttymouse') | 1899 call test_option_not_set('ttymouse') |
1895 | 1904 |
1896 call assert_equal(#{ | 1905 call assert_equal(#{ |
1897 \ cursor_style: 'n', | 1906 \ cursor_style: 'n', |
1898 \ cursor_blink_mode: 'u', | 1907 \ cursor_blink_mode: 'u', |
1899 \ underline_rgb: 'u', | 1908 \ underline_rgb: 'u', |
1900 \ mouse: 's' | 1909 \ mouse: 's', |
1910 \ kitty: 'u', | |
1901 \ }, terminalprops()) | 1911 \ }, terminalprops()) |
1902 | 1912 |
1903 " xterm >= 279: "sgr" and cursor_style not reset; also check t_8u reset, | 1913 " xterm >= 279: "sgr" and cursor_style not reset; also check t_8u reset, |
1904 " except when it was set by the user | 1914 " except when it was set by the user |
1905 call Do_check_t_8u_set_reset(0) | 1915 call Do_check_t_8u_set_reset(0) |
1906 call Do_check_t_8u_set_reset(1) | 1916 call Do_check_t_8u_set_reset(1) |
1917 | |
1918 set t_RV= | |
1919 call test_override('term_props', 0) | |
1920 endfunc | |
1921 | |
1922 func Test_xx08_kitty_response() | |
1923 " Termresponse is only parsed when t_RV is not empty. | |
1924 set t_RV=x | |
1925 call test_override('term_props', 1) | |
1926 | |
1927 set ttymouse=xterm | |
1928 call test_option_not_set('ttymouse') | |
1929 let seq = "\<Esc>[>1;4001;12c" | |
1930 call feedkeys(seq, 'Lx!') | |
1931 call assert_equal(seq, v:termresponse) | |
1932 call assert_equal('sgr', &ttymouse) | |
1933 | |
1934 call assert_equal(#{ | |
1935 \ cursor_style: 'u', | |
1936 \ cursor_blink_mode: 'u', | |
1937 \ underline_rgb: 'y', | |
1938 \ mouse: 's', | |
1939 \ kitty: 'y', | |
1940 \ }, terminalprops()) | |
1907 | 1941 |
1908 set t_RV= | 1942 set t_RV= |
1909 call test_override('term_props', 0) | 1943 call test_override('term_props', 0) |
1910 endfunc | 1944 endfunc |
1911 | 1945 |