Closed rxw1 closed 6 years ago
Hi @rwilhelm , I have been noticing that Ctrl-C doesn't work well with Neovim for some time. But was treating it as a neovim problem because that KeyboardInterupt exception should have captured the interupt signal induced exception. And it did, for Vim.
I have seen your code. Changing None
to 0
will not change the logic of that specific function. So I ignored the change. I have also tried to use package signal
to inhibit the signal interrupt. Strangely, it does not do anything for either NeoVim or Vim.
After looking into the exception thrown in NeoVim. I realized that the reason my exception handler didn't manage to capture the correct exception because NeoVim API intercepted the exception and thrown a different one, neovim.api.nvim.NvimError
. I specifically captured it on the occation, and now issue should be resolved. Please raise an issue to track it if it still affects you.
Also, if you are interested, please explore more on using signal interupt handling way of solution.
Closing the split window by just pressing Enter works, but maybe it would be nice to handle Ctrl-C as well.
A more proper implementation would probably to use
signal.signal(signal.SIGINT, func)
: https://stackoverflow.com/a/1112350/220472