@@ -171,6 +171,31 @@ runInputProcessorLoop classifyTable input = do
171 <*> pure (classify classifyTable)
171 <*> pure (classify classifyTable)
172 runReaderT (evalStateT loopInputProcessor s0) input
172 runReaderT (evalStateT loopInputProcessor s0) input
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.
178+-- This function constructs a configuration action to clear the
179+-- following terminal mode flags:
181+-- * IXON disabled: disables software flow control on outgoing data.
182+-- This stops the process from being suspended if the output terminal
185+-- * Raw mode is used for input.
187+-- * ISIG (enables keyboard combinations that result in
190+-- * ECHO (input is not echoed to the output)
192+-- * ICANON (canonical mode (line mode) input is not used)
194+-- * IEXTEN (extended functions are disabled)
196+-- The configuration actual also explicitly sets these flags:
198+-- * ICRNL (input carriage returns are mapped to newlines)
174attributeControl :: Fd -> IO (IO (), IO ())
199attributeControl :: Fd -> IO (IO (), IO ())
175attributeControl fd = do
200attributeControl fd = do
176 original <- getTerminalAttributes fd
201 original <- getTerminalAttributes fd