Mercurial > vim
comparison src/testdir/term_util.vim @ 20768:1e2e81dbb958 v8.2.0936
patch 8.2.0936: some terminals misinterpret the code for getting cursor style
Commit: https://github.com/vim/vim/commit/a45551a53557dba98973fdb3ff737dea2fffcda3
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 9 15:57:37 2020 +0200
patch 8.2.0936: some terminals misinterpret the code for getting cursor style
Problem: Some terminals misinterpret the code for getting cursor style.
Solution: Send a sequence to the terminal and check the result. (IWAMOTO
Kouichi, closes #2126) Merged with current code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 09 Jun 2020 16:00:05 +0200 |
parents | 6bcd12791bf1 |
children | 58137dbee8da |
comparison
equal
deleted
inserted
replaced
20767:c7edd278df99 | 20768:1e2e81dbb958 |
---|---|
42 " Run Vim with "arguments" in a new terminal window. | 42 " Run Vim with "arguments" in a new terminal window. |
43 " By default uses a size of 20 lines and 75 columns. | 43 " By default uses a size of 20 lines and 75 columns. |
44 " Returns the buffer number of the terminal. | 44 " Returns the buffer number of the terminal. |
45 " | 45 " |
46 " Options is a dictionary, these items are recognized: | 46 " Options is a dictionary, these items are recognized: |
47 " "keep_t_u7" - when 1 do not make t_u7 empty (resetting t_u7 avoids clearing | |
48 " parts of line 2 and 3 on the display) | |
47 " "rows" - height of the terminal window (max. 20) | 49 " "rows" - height of the terminal window (max. 20) |
48 " "cols" - width of the terminal window (max. 78) | 50 " "cols" - width of the terminal window (max. 78) |
49 " "statusoff" - number of lines the status is offset from default | 51 " "statusoff" - number of lines the status is offset from default |
50 func RunVimInTerminal(arguments, options) | 52 func RunVimInTerminal(arguments, options) |
51 " If Vim doesn't exit a swap file remains, causing other tests to fail. | 53 " If Vim doesn't exit a swap file remains, causing other tests to fail. |
72 " Make the window 20 lines high and 75 columns, unless told otherwise. | 74 " Make the window 20 lines high and 75 columns, unless told otherwise. |
73 let rows = get(a:options, 'rows', 20) | 75 let rows = get(a:options, 'rows', 20) |
74 let cols = get(a:options, 'cols', 75) | 76 let cols = get(a:options, 'cols', 75) |
75 let statusoff = get(a:options, 'statusoff', 1) | 77 let statusoff = get(a:options, 'statusoff', 1) |
76 | 78 |
77 let cmd = GetVimCommandCleanTerm() .. a:arguments | 79 if get(a:options, 'keep_t_u7', 0) |
80 let reset_u7 = '' | |
81 else | |
82 let reset_u7 = ' --cmd "set t_u7=" ' | |
83 endif | |
84 | |
85 let cmd = GetVimCommandCleanTerm() .. reset_u7 .. a:arguments | |
78 | 86 |
79 let options = { | 87 let options = { |
80 \ 'curwin': 1, | 88 \ 'curwin': 1, |
81 \ 'term_rows': rows, | 89 \ 'term_rows': rows, |
82 \ 'term_cols': cols, | 90 \ 'term_cols': cols, |