correctly handle the SIGINT signal

Ignore-this: ea0c2dbb5cba430cc586a66d26f094d1

darcs-hash:20110812211135-c41ad-ed9759f105d138c264cca67d0a0cdefda1a5f0a7
This commit is contained in:
Jeremie Dimino 2011-08-12 23:11:35 +02:00
parent 7a791ae5ef
commit 4b8ce2bf82
1 changed files with 4 additions and 0 deletions

View File

@ -439,8 +439,12 @@ let rec read_input term prompt buffer len =
end else
return ()
in
(* Restore the Lwt signal handler for SIGINT (Toploop catches it). *)
Lwt_unix.reinstall_signal_handler Sys.sigint;
(new read_line ~term ~prompt:prompt_to_display)#run
finally
(* Toploop need to catch the SIGINT signal. *)
Sys.catch_break true;
LTerm.flush term
) in