diff options
author | 2011-04-28 10:09:12 +0000 | |
---|---|---|
committer | 2011-04-28 10:09:12 +0000 | |
commit | f5276a11a40f86d5ed8ff14bd03d6ea71e7dad33 (patch) | |
tree | 45ac7fcd7ae7a24ba861371586107df42056344d /ide/coq.ml | |
parent | eee95fec8763a6323f27b86a5ee115305d4f3d9d (diff) |
Coqide: try to properly send interrupts to coqtop on Win32
We use GenerateConsoleCtrlEvent(CTRL_C_EVENT,...) after having
attached coqide to the console of the coqtop we want to interrupt.
Two caveats:
- This code isn't compatible with Windows < XP SP1.
- It relies on the fact that coqide is now a true GUI app, without
console by default. If for some reason the console of coqide is
restored (for instance via mkwinapp -unset), strange behavior
of the interrupt button is to be expected, at the very least all
instances of coqtop will get Ctrl-C instead of a precise one.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14077 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'ide/coq.ml')
-rw-r--r-- | ide/coq.ml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ide/coq.ml b/ide/coq.ml index ef444292d..6e8190722 100644 --- a/ide/coq.ml +++ b/ide/coq.ml @@ -172,12 +172,13 @@ let spawn_coqtop sup_args = let respawn_coqtop coqtop = spawn_coqtop coqtop.sup_args +let interrupter = ref (fun pid -> Unix.kill pid Sys.sigint) +let killer = ref (fun pid -> Unix.kill pid Sys.sigkill) + let break_coqtop coqtop = - try Unix.kill coqtop.pid Sys.sigint + try !interrupter coqtop.pid with _ -> prerr_endline "Error while sending Ctrl-C" -let killer = ref (fun pid -> Unix.kill pid Sys.sigkill) - let kill_coqtop coqtop = let pid = coqtop.pid in begin |