allow Ctrl+Break in the shell. Works on Windows too.

This commit is contained in:
kr.angelov
2008-05-23 15:16:28 +00:00
parent 0b80bf17d9
commit 53bfa43a58
5 changed files with 142 additions and 1 deletions

View File

@@ -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