1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2017-11-21 18:11:27 +01:00
parent 5505860152
commit 52dbb5ea7f
6 changed files with 82 additions and 34 deletions

View File

@@ -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