diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-27 08:21:24 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-03-27 08:27:44 -0400 |
commit | 6da06bc2492e6dd142b1805664082317bc04974e (patch) | |
tree | b887012e2f89d8952feab2106256a1ba0111cbb0 /src | |
parent | ff870232b868d7c6b1ae094f2c60c624321a53b9 (diff) | |
download | rneovim-6da06bc2492e6dd142b1805664082317bc04974e.tar.gz rneovim-6da06bc2492e6dd142b1805664082317bc04974e.tar.bz2 rneovim-6da06bc2492e6dd142b1805664082317bc04974e.zip |
vim-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)
https://github.com/vim/vim/commit/7007e31bde75b6360a1b54c7572e4f855458f37d
"Test_not_a_term" passes because Neovim does not support "--not-a-term" flag.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_startup.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index 4d1ad10c23..eb9378194f 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -862,6 +862,34 @@ func Test_x_arg() call delete('Xtest_x_arg') endfunc +" Test for --not-a-term avoiding escape codes. +func Test_not_a_term() + CheckUnix + CheckNotGui + + if &shellredir =~ '%s' + let redir = printf(&shellredir, 'Xvimout') + else + let redir = &shellredir .. ' Xvimout' + endif + + " Without --not-a-term there are a few escape sequences. + " This will take 2 seconds because of the missing --not-a-term + let cmd = GetVimProg() .. ' --cmd quit ' .. redir + exe "silent !" . cmd + " call assert_match("\<Esc>", readfile('Xvimout')->join()) + call assert_match("\<Esc>", join(readfile('Xvimout'))) + call delete('Xvimout') + + " With --not-a-term there are no escape sequences. + let cmd = GetVimProg() .. ' --not-a-term --cmd quit ' .. redir + exe "silent !" . cmd + " call assert_notmatch("\<Esc>", readfile('Xvimout')->join()) + call assert_notmatch("\<Esc>", join(readfile('Xvimout'))) + call delete('Xvimout') +endfunc + + " Test starting vim with various names: vim, ex, view, evim, etc. func Test_progname() CheckUnix |