diff src/testdir/test_terminal.vim @ 12907:32531a3eab1f v8.0.1330

patch 8.0.1330: MS-Windows: job in terminal can't get back to Vim commit https://github.com/vim/vim/commit/52dbb5ea7fde4a77178bc59e2383ca40df503812 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 21 18:11:27 2017 +0100 patch 8.0.1330: MS-Windows: job in terminal can't get back to Vim Problem: MS-Windows: job in terminal can't get back to Vim. Solution: set VIM_SERVERNAME in the environment. (Yasuhiro Matsumoto, closes #2360)
author Christian Brabandt <cb@256bit.org>
date Tue, 21 Nov 2017 18:15:06 +0100
parents 411a30bd7e8a
children 7a9c4a8b1ceb
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -434,6 +434,27 @@ func Test_terminal_cwd()
   call delete('Xdir', 'rf')
 endfunc
 
+func Test_terminal_servername()
+  if !has('clientserver')
+    return
+  endif
+  let g:buf = Run_shell_in_terminal({})
+  " Wait for the shell to display a prompt
+  call WaitFor('term_getline(g:buf, 1) != ""')
+  if has('win32')
+    call term_sendkeys(g:buf, "echo %VIM_SERVERNAME%\r")
+  else
+    call term_sendkeys(g:buf, "echo $VIM_SERVERNAME\r")
+  endif
+  call term_wait(g:buf)
+  call Stop_shell_in_terminal(g:buf)
+  call WaitFor('getline(2) == v:servername')
+  call assert_equal(v:servername, getline(2))
+
+  exe g:buf . 'bwipe'
+  unlet g:buf
+endfunc
+
 func Test_terminal_env()
   let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
   " Wait for the shell to display a prompt