@@ -1,5 +1,7 @@
11-- Copyright 2009-2010 Corey O'Connor
22--
3+-- Right, I'm mostly guessing on these details. So, as far as I can figure:
4+--
35-- There are two input modes:
46-- 1. 7 bit
57-- 2. 8 bit
@@ -45,10 +47,33 @@ defaultEscDelay = 4000
4547
4648-- | Set up the terminal for input. Returns a function which reads key
4749-- events, and a function for shutting down the terminal access.
50+--
51+-- The terminal is modified as follows:
52+--
53+-- * IXON disabled
54+-- - disables software flow control on outgoing data. This stops the process from being
55+-- suspended if the output terminal cannot keep up. I presume this has little effect these
56+-- days. I hope this means that output will be buffered if the terminal cannot keep up. In the
57+-- ol days the output might of been dropped.
58+--
59+-- "raw" mode is used for input.
60+--
61+-- * ISIG disabled
62+-- - enables keyboard combinations that result in signals. People would probably want this to
63+-- be an option.
64+--
65+-- * ECHO disabled
66+-- - input is not echod to the output.
67+--
68+-- * ICANON disabled
69+-- - canonical mode (line mode) input is not used.
70+--
71+-- * IEXTEN disabled
72+-- - extended functions are disabled. Uh. Whatever these are.
73+--
4874initTermInput :: Int -> Terminal -> IO (IO Event, IO ())
4975initTermInput escDelay terminal = do
5076 attr <- getTerminalAttributes stdInput
51− -- disable IXON,
5277 let attr' = foldl withoutMode attr [ StartStopOutput, KeyboardInterrupts
5378 , EnableEcho, ProcessInput, ExtendedFunctions
5479 ]