]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3251: listing builtin_gui as an available terminal is confusing v8.2.3251
authorBram Moolenaar <Bram@vim.org>
Fri, 30 Jul 2021 19:18:03 +0000 (21:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 30 Jul 2021 19:18:03 +0000 (21:18 +0200)
Problem:    Listing builtin_gui as an available terminal is confusing.
Solution:   Do not list builtin_gui. (Christian Brabandt, closes #8669,
            closes #8661)

src/term.c
src/testdir/test_termcodes.vim
src/version.c

index cec16b608a25d89e254dea064a4421ed03b504cd..a13959b1c31f1d05972ee50962a55b4b6972c5ca 100644 (file)
@@ -1786,7 +1786,8 @@ report_term_error(char *error_msg, char_u *term)
     mch_errmsg("\r\n");
     for (termp = &(builtin_termcaps[0]); termp->bt_string != NULL; ++termp)
     {
-       if (termp->bt_entry == (int)KS_NAME)
+       if (termp->bt_entry == (int)KS_NAME
+               && STRCMP(termp->bt_string, "gui") != 0)
        {
 #ifdef HAVE_TGETENT
            mch_errmsg("    builtin_");
index 2f2fe3b57c018de0175a7d0067c922de5fc6613d..f73770b3db435ef519f426a3235b0abe77617b86 100644 (file)
@@ -2348,4 +2348,16 @@ func Test_special_term_keycodes()
   bw!
 endfunc
 
+func Test_terminal_builtin_without_gui()
+  CheckNotMSWindows
+
+  " builtin_gui should not be output by :set term=xxx
+  let output = systemlist("TERM=dumb " .. v:progpath .. " --clean -c ':set t_ti= t_te=' -c 'set term=xxx' -c ':q!'")
+  redraw!
+  call map(output, {_, val -> trim(val)})
+  call assert_equal(-1, index(output, 'builtin_gui'))
+  call assert_notequal(-1, index(output, 'builtin_dumb'))
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab
index f324f3d9721c0e364c5fa77c441a1abfa3943963..046d1e74445e31f531af7d1e5f59ff5bcea7ea6e 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3251,
 /**/
     3250,
 /**/