changeset 19513:274052873790 v8.2.0314

patch 8.2.0314: short name not set for terminal buffer Commit: https://github.com/vim/vim/commit/e010c720b2024d8c6df45c60c6001c3b4f157de1 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 24 21:37:54 2020 +0100 patch 8.2.0314: short name not set for terminal buffer Problem: Short name not set for terminal buffer. Solution: Set the short name. (closes https://github.com/vim/vim/issues/5687)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Feb 2020 21:45:04 +0100
parents 8e63e95fca06
children 25f44b7a51b1
files src/terminal.c src/testdir/test_terminal.vim src/version.c
diffstat 3 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -566,6 +566,8 @@ term_start(
 	    }
 	}
     }
+    vim_free(curbuf->b_sfname);
+    curbuf->b_sfname = vim_strsave(curbuf->b_ffname);
     curbuf->b_fname = curbuf->b_ffname;
 
     if (opt->jo_term_opencmd != NULL)
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -2405,3 +2405,9 @@ func Test_issue_5607()
     bw!
   endtry
 endfunc
+
+func Test_hidden_terminal()
+  let buf = term_start(&shell, #{hidden: 1})
+  call assert_equal('', bufname('^$'))
+  call StopShellInTerminal(buf)
+endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    314,
+/**/
     313,
 /**/
     312,