// Create the terminal and run the command. This is not without
// risk, but let's assume the user only creates a session when this
// will be OK.
- if (fprintf(fd, "terminal ++curwin ++cols=%d ++rows=%d ",
- term->tl_cols, term->tl_rows) < 0)
+ if (fprintf(fd, "exe ':terminal ++curwin"
+ " ++cols=' .. ((&columns * %d + %ld) / %ld)"
+ " .. ' ++rows=' .. ((&lines * %d + %ld) / %ld) ",
+ term->tl_cols, Columns / 2, Columns,
+ term->tl_rows, Rows / 2, Rows) < 0)
return FAIL;
# ifdef MSWIN
- if (fprintf(fd, "++type=%s ", term->tl_job->jv_tty_type) < 0)
+ if (fprintf(fd, ".. ' ++type=%s' ", term->tl_job->jv_tty_type) < 0)
return FAIL;
# endif
if (term->tl_command != NULL && fputs((char *)term->tl_command, fd) < 0)
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
let term_cmd = line
elseif line =~ 'badd.*' . &shell
call assert_report('unexpected shell line: ' . line)
endif
endfor
- call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+\s*.*$', term_cmd)
+ call assert_match('exe '':terminal ++curwin ++cols='' \.\. ((&columns \* \d\+ + \d\+) \/ \d\+) \.\. '' ++rows='' \.\. ((&lines \* \d\+ + \d\+) \/ \d\+)\s.*$', term_cmd)
call StopShellInTerminal(bufnr('%'))
call delete('Xtest_mks.out')
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
call assert_report('session must not restore terminal')
endif
endfor
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
call assert_report('session must not restore terminal')
endif
endfor
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
call assert_report('session must not restore terminal')
endif
endfor
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
call assert_report('session must not restore terminal')
endif
endfor
let lines = readfile('Xtest_mks.out')
let term_cmd = ''
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
let term_cmd = line
endif
endfor
- call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+.*other', term_cmd)
+ call assert_match('exe '':terminal ++curwin ++cols='' \.\. ((&columns \* \d\+ + \d\+) \/ \d\+) \.\. '' ++rows='' \.\. ((&lines \* \d\+ + \d\+) \/ \d\+).*other', term_cmd)
call StopShellInTerminal(bufnr('%'))
call delete('Xtest_mks.out')
let found_var = 0
for line in lines
- if line =~ '^terminal'
+ if line =~ '^exe '':terminal'
let found_creation = 1
- call assert_match('terminal ++curwin ++cols=\d\+ ++rows=\d\+', line)
+ call assert_match('exe '':terminal ++curwin ++cols='' \.\. ((&columns \* \d\+ + \d\+) \/ \d\+) \.\. '' ++rows='' \.\. ((&lines \* \d\+ + \d\+) \/ \d\+)', line)
elseif line =~ $"^var term_buf_{term_buf}: number = bufnr()$"
let found_var = 1
elseif line =~ "^execute 'buffer ' . term_buf_" . term_buf . "$"