From 53bfa43a5820e0ac6cceb01b57776ae01b3b92f1 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 23 May 2008 15:16:28 +0000 Subject: allow Ctrl+Break in the shell. Works on Windows too. --- src-3.0/GF/Command/Interpreter.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src-3.0/GF/Command') diff --git a/src-3.0/GF/Command/Interpreter.hs b/src-3.0/GF/Command/Interpreter.hs index 10730e7ef..24f16ea1d 100644 --- a/src-3.0/GF/Command/Interpreter.hs +++ b/src-3.0/GF/Command/Interpreter.hs @@ -10,6 +10,7 @@ import GF.Command.ParGFShell import GF.GFCC.API import GF.GFCC.Macros import GF.GFCC.DataGFCC +import GF.System.Signal import GF.Data.ErrM ---- @@ -23,7 +24,10 @@ data CommandEnv = CommandEnv { interpretCommandLine :: CommandEnv -> String -> IO () interpretCommandLine env line = case (pCommandLine (myLexer line)) of Ok CEmpty -> return () - Ok (CLine pipes) -> mapM_ interPipe pipes + Ok (CLine pipes) -> do res <- runInterruptibly (mapM_ interPipe pipes) + case res of + Left ex -> print ex + Right x -> return x _ -> putStrLn "command not parsed" where interPipe (PComm cs) = do -- cgit v1.2.3