Commit b25d67d4 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Only initialise readline if we are connected to a terminal

Patch from Bertram Felgenhauer <int-e@gmx.de>
parent b9c0562f
......@@ -299,13 +299,15 @@ interactiveUI session srcs maybe_expr = do
hSetBuffering stdin NoBuffering
#ifdef USE_READLINE
Readline.initialize
Readline.setAttemptedCompletionFunction (Just completeWord)
--Readline.parseAndBind "set show-all-if-ambiguous 1"
Readline.setBasicWordBreakCharacters word_break_chars
Readline.setCompleterWordBreakCharacters word_break_chars
Readline.setCompletionAppendCharacter Nothing
is_tty <- hIsTerminalDevice stdin
when is_tty $ do
Readline.initialize
Readline.setAttemptedCompletionFunction (Just completeWord)
--Readline.parseAndBind "set show-all-if-ambiguous 1"
Readline.setBasicWordBreakCharacters word_break_chars
Readline.setCompleterWordBreakCharacters word_break_chars
Readline.setCompletionAppendCharacter Nothing
#endif
-- initial context is just the Prelude
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment