Skip to content

Commit cf67a50

Browse files
committed
patch 8.0.1644: terminal API tests still fail
Problem: Terminal API tests still fail. Solution: Explicitly set 'title' in the terminal job. (Ozaki Kiichi, closes #2750)
1 parent 2de50f8 commit cf67a50

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/testdir/screendump.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ source shared.vim
2424
" By default uses a size of 20 lines and 75 columns.
2525
" Returns the buffer number of the terminal.
2626
"
27-
" Options is a dictionary (not used yet).
27+
" Options is a dictionary, these items are recognized:
28+
" "rows" - height of the terminal window (max. 20)
29+
" "cols" - width of the terminal window (max. 78)
2830
func RunVimInTerminal(arguments, options)
2931
" If Vim doesn't exit a swap file remains, causing other tests to fail.
3032
" Remove it here.
@@ -47,17 +49,15 @@ func RunVimInTerminal(arguments, options)
4749
set t_Co=256 background=light
4850
hi Normal ctermfg=NONE ctermbg=NONE
4951

50-
" Make the window 20 lines high, unless told otherwise.
51-
let rows = 20
52-
if has_key(a:options, 'rows')
53-
let rows = a:options['rows']
54-
endif
52+
" Make the window 20 lines high and 75 columns, unless told otherwise.
53+
let rows = get(a:options, 'rows', 20)
54+
let cols = get(a:options, 'cols', 75)
5555

5656
let cmd = GetVimCommandClean()
5757
" Add -v to have gvim run in the terminal (if possible)
5858
let cmd .= ' -v ' . a:arguments
59-
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': 75})
60-
call assert_equal([rows, 75], term_getsize(buf))
59+
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': cols})
60+
call assert_equal([rows, cols], term_getsize(buf))
6161

6262
return buf
6363
endfunc

src/testdir/test_terminal.vim

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,10 +1029,10 @@ func Test_terminal_api_drop_newwin()
10291029
return
10301030
endif
10311031
call assert_equal(1, winnr('$'))
1032-
set title
10331032

10341033
" Use the title termcap entries to output the escape sequence.
10351034
call writefile([
1035+
\ 'set title',
10361036
\ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
10371037
\ 'let &titlestring = ''["drop","Xtextfile"]''',
10381038
\ 'redraw',
@@ -1046,7 +1046,6 @@ func Test_terminal_api_drop_newwin()
10461046
call StopVimInTerminal(buf)
10471047
call delete('Xscript')
10481048
bwipe Xtextfile
1049-
set title&
10501049
endfunc
10511050

10521051
func Test_terminal_api_drop_oldwin()
@@ -1058,10 +1057,10 @@ func Test_terminal_api_drop_oldwin()
10581057
let textfile_winid = win_getid()
10591058
call assert_equal(2, winnr('$'))
10601059
call win_gotoid(firstwinid)
1061-
set title
10621060

10631061
" Use the title termcap entries to output the escape sequence.
10641062
call writefile([
1063+
\ 'set title',
10651064
\ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
10661065
\ 'let &titlestring = ''["drop","Xtextfile"]''',
10671066
\ 'redraw',
@@ -1074,7 +1073,6 @@ func Test_terminal_api_drop_oldwin()
10741073
call StopVimInTerminal(buf)
10751074
call delete('Xscript')
10761075
bwipe Xtextfile
1077-
set title&
10781076
endfunc
10791077

10801078
func TryThis(bufnum, arg)
@@ -1086,10 +1084,10 @@ func Test_terminal_api_call()
10861084
if !CanRunVimInTerminal()
10871085
return
10881086
endif
1089-
set title
10901087

10911088
" Use the title termcap entries to output the escape sequence.
10921089
call writefile([
1090+
\ 'set title',
10931091
\ 'exe "set t_ts=\<Esc>]51; t_fs=\x07"',
10941092
\ 'let &titlestring = ''["call","TryThis",["hello",123]]''',
10951093
\ 'redraw',
@@ -1104,5 +1102,4 @@ func Test_terminal_api_call()
11041102
call delete('Xscript')
11051103
unlet g:called_bufnum
11061104
unlet g:called_arg
1107-
set title&
11081105
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1644,
769771
/**/
770772
1643,
771773
/**/

0 commit comments

Comments
 (0)