Mercurial > vim
comparison src/testdir/test_startup.vim @ 24242:d3cabf12c991 v8.2.2662
patch 8.2.2662: there is no way to avoid some escape sequences
Commit: https://github.com/vim/vim/commit/7007e31bde75b6360a1b54c7572e4f855458f37d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 12:11:33 2021 +0100
patch 8.2.2662: there is no way to avoid some escape sequences
Problem: There is no way to avoid some escape sequences.
Solution: Suppress escape sequences when the --not-a-term argument is used.
(Gary Johnson)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 12:15:04 +0100 |
parents | ed0fc4787392 |
children | acd9220bdd0b |
comparison
equal
deleted
inserted
replaced
24241:2caf37eac41b | 24242:d3cabf12c991 |
---|---|
1040 CheckEnglish | 1040 CheckEnglish |
1041 let l = systemlist(GetVimProg() .. ' --ttyfail') | 1041 let l = systemlist(GetVimProg() .. ' --ttyfail') |
1042 call assert_equal(['Vim: Warning: Output is not to a terminal', | 1042 call assert_equal(['Vim: Warning: Output is not to a terminal', |
1043 \ 'Vim: Warning: Input is not from a terminal'], l) | 1043 \ 'Vim: Warning: Input is not from a terminal'], l) |
1044 endfunc | 1044 endfunc |
1045 | |
1046 " Test for --not-a-term avoiding escape codes. | |
1047 func Test_not_a_term() | |
1048 CheckUnix | |
1049 CheckNotGui | |
1050 | |
1051 if &shellredir =~ '%s' | |
1052 let redir = printf(&shellredir, 'Xvimout') | |
1053 else | |
1054 let redir = &shellredir .. ' Xvimout' | |
1055 endif | |
1056 | |
1057 " Without --not-a-term there are a few escape sequences. | |
1058 " This will take 2 seconds because of the missing --not-a-term | |
1059 let cmd = GetVimProg() .. ' --cmd quit ' .. redir | |
1060 exe "silent !" . cmd | |
1061 call assert_match("\<Esc>", readfile('Xvimout')->join()) | |
1062 call delete('Xvimout') | |
1063 | |
1064 " With --not-a-term there are no escape sequences. | |
1065 let cmd = GetVimProg() .. ' --not-a-term --cmd quit ' .. redir | |
1066 exe "silent !" . cmd | |
1067 call assert_notmatch("\<Esc>", readfile('Xvimout')->join()) | |
1068 call delete('Xvimout') | |
1069 endfunc | |
1070 | |
1045 | 1071 |
1046 " Test for the "-w scriptout" argument | 1072 " Test for the "-w scriptout" argument |
1047 func Test_w_arg() | 1073 func Test_w_arg() |
1048 " Can't catch the output of gvim. | 1074 " Can't catch the output of gvim. |
1049 CheckNotGui | 1075 CheckNotGui |