0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.0.0936: mode() returns wrong value for a terminal window

Problem:    Mode() returns wrong value for a terminal window.
Solution:   Return 't' when typed keys go to a job.
This commit is contained in:
Bram Moolenaar 2017-08-13 20:58:33 +02:00
parent 304b64c9e6
commit 2bb7b6b0e4
3 changed files with 11 additions and 0 deletions

View File

@ -7849,6 +7849,10 @@ f_mode(typval_T *argvars, typval_T *rettv)
buf[0] = 'x';
buf[1] = '!';
}
#ifdef FEAT_TERMINAL
else if (term_use_loop())
buf[0] = 't';
#endif
else if (VIsual_active)
{
if (VIsual_select)

View File

@ -42,8 +42,13 @@ func Test_terminal_basic()
call assert_match("^winpty://", job_info(g:job).tty)
call assert_match("^winpty://", term_gettty(''))
endif
call assert_equal('t', mode())
call assert_match('%aR[^\n]*running]', execute('ls'))
call Stop_shell_in_terminal(buf)
call term_wait(buf)
call assert_equal('n', mode())
call assert_match('%aF[^\n]*finished]', execute('ls'))
" closing window wipes out the terminal buffer a with finished job
close

View File

@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
936,
/**/
935,
/**/