@@ -437,10 +437,10 @@ handleKindOf typ = do
437437-- Parses the input and returns either a Metacommand, or an error as a string.
438438--
439439getCommand :: Bool -> InputT (StateT PSCiState IO) (Either String (Maybe Command))
440−getCommand singleLineMode = do
441− firstLine <- getInputLine "> "
440+getCommand singleLineMode = handleInterrupt (return (Right Nothing)) $ do
441+ firstLine <- withInterrupt $ getInputLine "> "
442442 case firstLine of
443− Nothing -> return (Right Nothing)
443+ Nothing -> return (Right (Just QuitPSCi)) -- Ctrl-D when input is empty
444444 Just "" -> return (Right Nothing)
445445 Just s | singleLineMode || head s == ':' -> return . either Left (Right . Just) $ parseCommand s
446446 Just s -> either Left (Right . Just) . parseCommand <$> go [s]