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:
@@ -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
|
||||
|
Reference in New Issue
Block a user