Mercurial > vim
diff src/testdir/test_terminal.vim @ 12724:17c257dd2438 v8.0.1240
patch 8.0.1240: MS-Windows: term_start() does not support environment
commit https://github.com/vim/vim/commit/ba6febd380c931b92361a189e85b19ed467c9c64
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 30 21:56:23 2017 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 30 Oct 2017 22:00:06 +0100 |
parents | f58755eb453e |
children | 810a4c3d4f7e |
line wrap: on
line diff
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -11,7 +11,11 @@ let s:python = PythonProg() " 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 @@ func Test_terminal_cwd() 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"')