# HG changeset patch # User Bram Moolenaar # Date 1596565803 -7200 # Node ID 1d75baa22d9a8b0217bf12d8c9fff4bbcb7173e2 # Parent a9bc567389ff458b4bfc2a3d3aa39b81f9f90889 patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message Commit: https://github.com/vim/vim/commit/ecd34bf55d72f530859e290ac02ee41f9fb27cce Author: Bram Moolenaar Date: Tue Aug 4 20:17:31 2020 +0200 patch 8.2.1362: last entry of ":set term=xxx" overwritten by error message Problem: Last entry of ":set term=xxx" overwritten by error message when 'cmdheight' is two or more. (Tony Mechelynck) Solution: Output extra line breaks. diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -1763,6 +1763,7 @@ get_term_entries(int *height, int *width report_term_error(char *error_msg, char_u *term) { struct builtin_term *termp; + int i; mch_errmsg("\r\n"); if (error_msg != NULL) @@ -1787,6 +1788,10 @@ report_term_error(char *error_msg, char_ mch_errmsg("\r\n"); } } + // Output extra 'cmdheight' line breaks to avoid that the following error + // message overwrites the last terminal name. + for (i = 1; i < p_ch; ++i) + mch_errmsg("\r\n"); } static void diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -7,6 +7,7 @@ CheckUnix source shared.vim source mouse.vim +source view_util.vim func Test_term_mouse_left_click() new @@ -1893,6 +1894,17 @@ func Test_get_termcode() set ttybuiltin endfunc +func Test_list_builtin_terminals() + let buf = RunVimInTerminal('', #{rows: 14}) + call term_sendkeys(buf, ":set cmdheight=3\") + call term_wait(buf, 100) + call term_sendkeys(buf, ":set term=xxx\") + call term_wait(buf, 100) + call assert_match('builtin_dumb', term_getline(buf, 11)) + call assert_match('Not found in termcap', term_getline(buf, 12)) + call StopVimInTerminal(buf) +endfunc + func GetEscCodeCSI27(key, modifier) let key = printf("%d", char2nr(a:key)) let mod = printf("%d", a:modifier) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1362, +/**/ 1361, /**/ 1360,