Conversation
The previous method of closing input/output unconditionally will cause
Vim to end with SIGHUP, which causes a wrapping process using Python's
`subprocess` module to abort:
10342 0.000166 write(1, "Vim: Finished.\r\n", 16) = -1 EIO (Input/output error)
10342 0.000169 rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7ff4714958f0}, {sa_handler=SIG_IGN, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_REST>
10342 0.000122 rt_sigprocmask(SIG_UNBLOCK, [HUP], [HUP], 8) = 0
10342 0.000081 getpid() = 10342
10342 0.000058 kill(10342, SIGHUP) = 0
10342 0.000103 --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=10342, si_uid=1000} ---
Using `:quitall!` and waiting for Vim to finish is cleaner.
This also uses SIGTERM instead of SIGKILL.
Fixes AndrewRadev#51.
|
Killing the server with TERM instead of KILL makes a lot of sense, for sure. If nothing else, we could do the "TERM -> wait for timeout -> KILL after 3 seconds" thing you're doing. Quitting with What do you think? Would it be good enough to have two methods? A |
|
Also, I have no idea what order the |
|
Your plan sounds good.
Sure. I've moved But I was a bit confused myself, given that I run Vim wrapped in covimerage (a Python program that uses
Is Depending on what you used the Not sure what to do here - maybe using TERM would be a good first step (waiting up to X seconds and then using KILL), without the quitall? |
First off, it's not a huge deal. The Vimrunner test suite itself probably calls The slowdown is probably due to whatever cleanup a Vim instance does when it's closed, maybe cleaning temporary files, maybe some other work. One extra command probably adds to it as well. With a What I would go with is three functions:
That way, if you really need fast relaunching of a Vim instance, you could hard-kill it, and if you want to be sure everything is cleaned up as in your case, you could use If you're okay with implementing that, I can then look to expose some configuration option for the test helpers, apart from |
The previous method of closing input/output unconditionally will cause
Vim to end with SIGHUP, which causes a wrapping process using Python's
subprocessmodule to abort:Using
:quitall!and waiting for Vim to finish is cleaner.This also uses SIGTERM instead of SIGKILL.
Fixes #51.