From: Christian Brabandt Date: Mon, 22 Jun 2026 19:45:05 +0000 (+0000) Subject: patch 9.2.0706: tests: test_terminal3 may fail when $SHELL is zsh X-Git-Tag: v9.2.0706^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fd0a9cc303c94c9f894f7f52181bd0b1f06f4b3;p=thirdparty%2Fvim.git patch 9.2.0706: tests: test_terminal3 may fail when $SHELL is zsh Problem: tests: test_terminal3 may fail when the shell ($SHELL) is zsh with a custom prompt, because the prompt wraps the terminal line and shifts the expected output. Solution: Reset $HOME and $PS1 to sane defaults so the shell uses a minimal prompt, and adjust the expected window height. closes: #20599 Signed-off-by: Christian Brabandt --- diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim index 22d19909a5..cf87038ef1 100644 --- a/src/testdir/test_terminal3.vim +++ b/src/testdir/test_terminal3.vim @@ -1197,7 +1197,7 @@ func Test_terminal_max_combining_chars() " somehow doesn't work on MS-Windows CheckUnix let cmd = "cat samples/terminal_max_combining_chars.txt\" - let buf = Run_shell_in_terminal({'term_rows': 15, 'term_cols': 35}) + let buf = Run_shell_in_terminal({'term_rows': 15, 'term_cols': 35, 'env': {'HOME': '/nonexisting', 'PS1':''}}) call TermWait(buf) call term_sendkeys(buf, cmd) " last char is a space with many combining chars @@ -1214,6 +1214,8 @@ func Test_term_getpos() defer delete('XTest_getpos_result') let lines =<< trim EOL + let $PS1='' + let $HOME='/nonexisting' term ++curwin sh EOL call writefile(lines, 'XTest_getpos', 'D') @@ -1243,8 +1245,8 @@ func Test_term_getpos() call WaitForAssert({-> assert_true(filereadable('XTest_getpos_result'))}) call WaitForAssert({-> assert_equal(2, len(readfile('XTest_getpos_result')))}) let result = readfile('XTest_getpos_result') - " 15 - 1: statusline - 1: for prompt line - call assert_equal(13, str2nr(result[1]) - str2nr(result[0])) + " 15 - 1: statusline - 1: for prompt line, w$-w0 = 12 + call assert_equal(12, str2nr(result[1]) - str2nr(result[0])) call assert_true(str2nr(result[0]) > 1) " Regression: line('w0') and line('w$') must not move cursor position diff --git a/src/version.c b/src/version.c index 14fb4ea489..e663c2117f 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 706, /**/ 705, /**/