patch 8.0.1240: MS-Windows: term_start() does not support environment
Problem: MS-Windows: term_start() does not support environment.
Solution: Implement the environment argument. (Yasuhiro Matsumoto, closes
#2264)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index bd7821d..95c1b98 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -11,7 +11,11 @@
" Open a terminal with a shell, assign the job to g:job and return the buffer
" number.
func Run_shell_in_terminal(options)
- let buf = term_start(&shell, a:options)
+ if has('win32')
+ let buf = term_start([&shell,'/k'], a:options)
+ else
+ let buf = term_start(&shell, a:options)
+ endif
let termlist = term_list()
call assert_equal(1, len(termlist))
@@ -430,13 +434,14 @@
endfunc
func Test_terminal_env()
- if !has('unix')
- return
- endif
let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
" Wait for the shell to display a prompt
call WaitFor('term_getline(g:buf, 1) != ""')
- call term_sendkeys(g:buf, "echo $TESTENV\r")
+ if has('win32')
+ call term_sendkeys(g:buf, "echo %TESTENV%\r")
+ else
+ call term_sendkeys(g:buf, "echo $TESTENV\r")
+ endif
call term_wait(g:buf)
call Stop_shell_in_terminal(g:buf)
call WaitFor('getline(2) == "correct"')