-
Notifications
You must be signed in to change notification settings - Fork 1.2k
catch_break does not always catch break #3747
Copy link
Copy link
Closed
Labels
Stalefeature-wishknown-limitationAcknowledge the problem, but there is no plan to fix itAcknowledge the problem, but there is no plan to fix itstdlib
Description
Original bug ID: 3747
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: runtime system and C interface
Bug description
Full_Name: Henri
Version: 3.08.2
OS: linux
Submission from: aorleans-104-1-15-86.w80-11.abo.wanadoo.fr (80.11.35.86)
The following program never catches Ctrl+C in a terminal and loops forever.
let _ =
Sys.catch_break true;
try
while true do
()
done
with
Sys.Break -> prerr_endline "QUIT!"The following program works as expected though!
let _ =
Sys.catch_break true;
try
while true do
ignore (input_line stdin)
done
with
Sys.Break -> prerr_endline "QUIT!"The following program does not catch break of course, but exits properly when
Ctrl+C is pressed in the same environment.
let _ =
try
while true do
()
done
with
Sys.Break -> prerr_endline "QUIT!" (* useless, kept anyway *)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stalefeature-wishknown-limitationAcknowledge the problem, but there is no plan to fix itAcknowledge the problem, but there is no plan to fix itstdlib