joonty/vdebug — pull request #6 by artnez (2012-08-31 05:44:08+00:00)
Title: Add initial support for user interrupt.

**This is not ready for production yet.**

I wanted to get started with support for user interrupts while the connection waits. When the user types by accident, it's very annoying to have to wait X seconds while the socket connection blocks.

This branch adds support for user interrupt while the connection to xdebug waits.

There are a few issues with code at the moment:

* It's coupled with VIM (`import vim` at the top of `dbgp.py`). My understanding is you want your library to be decoupled from VIM. I'll think about a way to handle user interrupts without poisoning `dbgp.py` with VIM related calls.
* I only tested this in my environment. I'm particularly interested to see how `socket.setblocking(0)` will work on Windows.
* When `vim.eval("getchar(0)")` captures an interrupt, it's printing "KeyboardInterrupt:" into the debug window for some reason. I can't figure out a way to prevent this.

Any suggestions welcome!