@@ -171,6 +171,31 @@ runInputProcessorLoop classifyTable input = do
171171 <*> pure (classify classifyTable)
172172 runReaderT (evalStateT loopInputProcessor s0) input
173173
174+-- | Construct two IO actions: one to configure the terminal for Vty and
175+-- one to restore the terminal mode flags to the values they had at the
176+-- time this function was called.
177+--
178+-- This function constructs a configuration action to clear the
179+-- following terminal mode flags:
180+--
181+-- * IXON disabled: disables software flow control on outgoing data.
182+-- This stops the process from being suspended if the output terminal
183+-- cannot keep up.
184+--
185+-- * Raw mode is used for input.
186+--
187+-- * ISIG (enables keyboard combinations that result in
188+-- signals)
189+--
190+-- * ECHO (input is not echoed to the output)
191+--
192+-- * ICANON (canonical mode (line mode) input is not used)
193+--
194+-- * IEXTEN (extended functions are disabled)
195+--
196+-- The configuration actual also explicitly sets these flags:
197+--
198+-- * ICRNL (input carriage returns are mapped to newlines)
174199attributeControl :: Fd -> IO (IO (), IO ())
175200attributeControl fd = do
176201 original <- getTerminalAttributes fd