Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad DISPLAY leaves swap file for test16 #692

Closed
Patterner opened this issue Mar 16, 2016 · 3 comments
Closed

bad DISPLAY leaves swap file for test16 #692

Patterner opened this issue Mar 16, 2016 · 3 comments

Comments

@Patterner
Copy link

If the DISPLAY variable is set to a bad value (so that the distplay cannot be opened)
running the test suite results in a bad test16 and afterwards a swap file is left and
that disturbs the next test run, even with a fixed DISPLAY

export DISPLAY=:99
make test
ls ./src/testdir/.test16.in.swp

@chrisbra
Copy link
Member

Hm, with an incorrect DISPLAY variable the test will fail or you should get the message: test16 NOT OUTPUT But I don't see it. However, you are right, if the gui fails, the swapfile stays open. I am not sure, if this is a bug, that should be fixed within Vim or if it is enough to fix the test:

diff --git a/src/testdir/test16.in b/src/testdir/test16.in
--- a/src/testdir/test16.in
+++ b/src/testdir/test16.in
@@ -4,7 +4,7 @@ For KDE set a font, empty 'guifont' may
 STARTTEST
 :so small.vim
 :if $DISPLAY == "" | e! test.ok | wq! test.out | endif
-:set exrc secure
+:set exrc secure noswapfile
 :if has("gui_kde")
 :  set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0
 :endif

@jamessan
Copy link
Contributor

A possibly related issue is that if Vim is waiting on a user prompt (like the swap-file prompt or a call to input()) and it loses the connection to X, Vim will either crash or start spinning in a loop.

This is easily reproducible by:

  1. Start an X session
  2. Start either screen or tmux
  3. Run vim -c 'exe "!kill -9 ".getpid()' foo
  4. Run vim foo and let it sit at the swap-file prompt
  5. Detach from screen/tmux
  6. Restart X

@brammool
Copy link
Contributor

Christian Brabandt wrote:

Hm, with an incorrect DISPLAY variable the test will fail or you
should get the message: test16 NOT OUTPUT But I don't see it.
However, you are right, if the gui fails, the swapfile stays open. I
am not sure, if this is a bug, that should be fixed within Vim or if
it is enough to fix the test:

That is working around the actual problem, which is that exit() is
called directly. I'll make a fix.

hundred-and-one symptoms of being an internet addict:
85. Choice between paying Compuserve bill and paying for kids education
is a no brainer -- although a bit painful for your kids.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \
\ an exciting new programming language -- http://www.Zimbu.org ///
\ help me help AIDS victims -- http://ICCF-Holland.org ///

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants