comparison src/testdir/test_terminal.vim @ 18039:ef5720fb6f41 v8.1.2015

patch 8.1.2015: terminal altscreen test still fails sometimes Commit: https://github.com/vim/vim/commit/bf9a3b0164e649b357d6218b4358208288b6fb7e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 8 22:35:48 2019 +0200 patch 8.1.2015: terminal altscreen test still fails sometimes Problem: Terminal altscreen test still fails sometimes. Solution: Write the escape sequence in a file.
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Sep 2019 22:45:03 +0200
parents 6a7b778119f1
children 060e1b1220c6
comparison
equal deleted inserted replaced
18038:474da17e65dd 18039:ef5720fb6f41
2086 set splitright& 2086 set splitright&
2087 only! 2087 only!
2088 endfunc 2088 endfunc
2089 2089
2090 func Test_terminal_altscreen() 2090 func Test_terminal_altscreen()
2091 CheckUnix 2091 if has('win32')
2092 let cmd = "type Xtext\<CR>"
2093 else
2094 let cmd = "cat Xtext\<CR>"
2095 endif
2092 2096
2093 let buf = term_start(&shell, {}) 2097 let buf = term_start(&shell, {})
2094 2098 call writefile(["\<Esc>[?1047h"], 'Xtext')
2095 call term_sendkeys(buf, 'echo "\e[?1047h"' .. "\r") 2099 call term_sendkeys(buf, cmd)
2096 call WaitForAssert({-> assert_equal(1, term_getaltscreen(buf))}) 2100 call WaitForAssert({-> assert_equal(1, term_getaltscreen(buf))})
2097 2101
2098 call term_sendkeys(buf, 'echo "\e[?1047l"' .. "\r") 2102 call writefile(["\<Esc>[?1047l"], 'Xtext')
2103 call term_sendkeys(buf, cmd)
2099 call WaitForAssert({-> assert_equal(0, term_getaltscreen(buf))}) 2104 call WaitForAssert({-> assert_equal(0, term_getaltscreen(buf))})
2100 2105
2101 call term_sendkeys(buf, "exit\r") 2106 call term_sendkeys(buf, "exit\r")
2102 exe buf . "bwipe!" 2107 exe buf . "bwipe!"
2103 endfunc 2108 call delete('Xtext')
2109 endfunc