mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
Ctrl-C shouldn't terminate the GF shell
This quick fix should make Ctrl-C in the GF shell behave more like it does in other shells: even if no command is running, Ctrl-C now just gives you a new prompt instead of terminating the shell.
This commit is contained in:
@@ -294,10 +294,11 @@ fetchCommand gfenv = do
|
|||||||
Haskeline.historyFile = Just path,
|
Haskeline.historyFile = Just path,
|
||||||
Haskeline.autoAddHistory = True
|
Haskeline.autoAddHistory = True
|
||||||
}
|
}
|
||||||
res <- Haskeline.runInputT settings (Haskeline.getInputLine (prompt (commandenv gfenv)))
|
res <- runInterruptibly $ Haskeline.runInputT settings (Haskeline.getInputLine (prompt (commandenv gfenv)))
|
||||||
case res of
|
case res of
|
||||||
Nothing -> return "q"
|
Left _ -> return ""
|
||||||
Just s -> return s
|
Right Nothing -> return "q"
|
||||||
|
Right (Just s) -> return s
|
||||||
|
|
||||||
importInEnv :: GFEnv -> Options -> [FilePath] -> IO GFEnv
|
importInEnv :: GFEnv -> Options -> [FilePath] -> IO GFEnv
|
||||||
importInEnv gfenv opts files
|
importInEnv gfenv opts files
|
||||||
|
|||||||
Reference in New Issue
Block a user