diff options
| author | kr.angelov <kr.angelov@chalmers.se> | 2008-05-23 15:16:28 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@chalmers.se> | 2008-05-23 15:16:28 +0000 |
| commit | 53bfa43a5820e0ac6cceb01b57776ae01b3b92f1 (patch) | |
| tree | e29707cb9f68f09d457ec18394183b8e487d43f6 /src-3.0/GF/Command | |
| parent | 0b80bf17d97fe5410c4e6697b6325c777dfee5b0 (diff) | |
allow Ctrl+Break in the shell. Works on Windows too.
Diffstat (limited to 'src-3.0/GF/Command')
| -rw-r--r-- | src-3.0/GF/Command/Interpreter.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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 |
