From d7a137fb0d980545dd567bee9c24cf7b9c3a2eae Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 12 Jun 2018 18:05:24 +0200 Subject: patch 8.1.0049: shell cannot tell running in a terminal window Problem: Shell cannot tell running in a terminal window. Solution: Add the VIM_TERMINAL environment variable. (Christian Brabandt) --- src/testdir/test_terminal.vim | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/testdir/test_terminal.vim') diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 3d06eb387..c082b3b73 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -482,18 +482,25 @@ func Test_terminal_servername() if !has('clientserver') return endif + call s:test_environment("VIM_SERVERNAME", v:servername) +endfunc + +func Test_terminal_version() + call s:test_environment("VIM_TERMINAL", string(v:version)) +endfunc + +func s:test_environment(name, value) let buf = Run_shell_in_terminal({}) " Wait for the shell to display a prompt call WaitForAssert({-> assert_notequal('', term_getline(buf, 1))}) if has('win32') - call term_sendkeys(buf, "echo %VIM_SERVERNAME%\r") + call term_sendkeys(buf, "echo %" . a:name . "%\r") else - call term_sendkeys(buf, "echo $VIM_SERVERNAME\r") + call term_sendkeys(buf, "echo $" . a:name . "\r") endif call term_wait(buf) call Stop_shell_in_terminal(buf) - call WaitFor('getline(2) == v:servername') - call assert_equal(v:servername, getline(2)) + call WaitForAssert({-> assert_equal(a:value, getline(2))}) exe buf . 'bwipe' unlet buf -- cgit v1.2.3