| Haskell Hierarchical Libraries (unix package) | Contents | Index

System.Posix.Terminal

Portability | non-portable (requires POSIX)
Stability | provisional
Maintainer | libraries@haskell.org

Contents

Terminal support
  Terminal attributes
  Terminal operations
  Process groups
  Testing a file descriptor

Description
POSIX Terminal support
Synopsis

data TerminalAttributes
getTerminalAttributes :: Fd -> IO TerminalAttributes

data TerminalState

= Immediately
| WhenDrained
| WhenFlushed

setTerminalAttributes :: Fd -> TerminalAttributes -> TerminalState -> IO ()

data TerminalMode

= InterruptOnBreak
| MapCRtoLF
| IgnoreBreak
| IgnoreCR
| IgnoreParityErrors
| MapLFtoCR
| CheckParity
| StripHighBit
| StartStopInput
| StartStopOutput
| MarkParityErrors
| ProcessOutput
| LocalMode
| ReadEnable
| TwoStopBits
| HangupOnClose
| EnableParity
| OddParity
| EnableEcho
| EchoErase
| EchoKill
| EchoLF
| ProcessInput
| ExtendedFunctions
| KeyboardInterrupts
| NoFlushOnInterrupt
| BackgroundWriteInterrupt

withoutMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
withMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
terminalMode :: TerminalMode -> TerminalAttributes -> Bool
bitsPerByte :: TerminalAttributes -> Int
withBits :: TerminalAttributes -> Int -> TerminalAttributes

data ControlCharacter

= EndOfFile
| EndOfLine
| Erase
| Interrupt
| Kill
| Quit
| Start
| Stop
| Suspend

controlChar :: TerminalAttributes -> ControlCharacter -> Maybe Char
withCC :: TerminalAttributes -> (ControlCharacter, Char) -> TerminalAttributes
withoutCC :: TerminalAttributes -> ControlCharacter -> TerminalAttributes
inputTime :: TerminalAttributes -> Int
withTime :: TerminalAttributes -> Int -> TerminalAttributes
minInput :: TerminalAttributes -> Int
withMinInput :: TerminalAttributes -> Int -> TerminalAttributes

data BaudRate

= B0
| B50
| B75
| B110
| B134
| B150
| B200
| B300
| B600
| B1200
| B1800
| B2400
| B4800
| B9600
| B19200
| B38400

inputSpeed :: TerminalAttributes -> BaudRate
withInputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
outputSpeed :: TerminalAttributes -> BaudRate
withOutputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
sendBreak :: Fd -> Int -> IO ()
drainOutput :: Fd -> IO ()

data QueueSelector

= InputQueue
| OutputQueue
| BothQueues

discardData :: Fd -> QueueSelector -> IO ()

data FlowAction

= SuspendOutput
| RestartOutput
| TransmitStop
| TransmitStart

controlFlow :: Fd -> FlowAction -> IO ()
getTerminalProcessGroupID :: Fd -> IO ProcessGroupID
setTerminalProcessGroupID :: Fd -> ProcessGroupID -> IO ()
queryTerminal :: Fd -> IO Bool
getTerminalName :: Fd -> IO FilePath
getControllingTerminalName :: IO FilePath

Terminal support
Terminal attributes
data TerminalAttributes

getTerminalAttributes :: Fd -> IO TerminalAttributes
data TerminalState

Constructors

Immediately |
WhenDrained |
WhenFlushed |

setTerminalAttributes :: Fd -> TerminalAttributes -> TerminalState -> IO ()
data TerminalMode

Constructors

InterruptOnBreak |
MapCRtoLF |
IgnoreBreak |
IgnoreCR |
IgnoreParityErrors |
MapLFtoCR |
CheckParity |
StripHighBit |
StartStopInput |
StartStopOutput |
MarkParityErrors |
ProcessOutput |
LocalMode |
ReadEnable |
TwoStopBits |
HangupOnClose |
EnableParity |
OddParity |
EnableEcho |
EchoErase |
EchoKill |
EchoLF |
ProcessInput |
ExtendedFunctions |
KeyboardInterrupts |
NoFlushOnInterrupt |
BackgroundWriteInterrupt |

withoutMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
withMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
terminalMode :: TerminalMode -> TerminalAttributes -> Bool
bitsPerByte :: TerminalAttributes -> Int
withBits :: TerminalAttributes -> Int -> TerminalAttributes
data ControlCharacter

Constructors

EndOfFile |
EndOfLine |
Erase |
Interrupt |
Kill |
Quit |
Start |
Stop |
Suspend |

controlChar :: TerminalAttributes -> ControlCharacter -> Maybe Char
withCC :: TerminalAttributes -> (ControlCharacter, Char) -> TerminalAttributes
withoutCC :: TerminalAttributes -> ControlCharacter -> TerminalAttributes
inputTime :: TerminalAttributes -> Int
withTime :: TerminalAttributes -> Int -> TerminalAttributes
minInput :: TerminalAttributes -> Int
withMinInput :: TerminalAttributes -> Int -> TerminalAttributes
data BaudRate

Constructors

B0 |
B50 |
B75 |
B110 |
B134 |
B150 |
B200 |
B300 |
B600 |
B1200 |
B1800 |
B2400 |
B4800 |
B9600 |
B19200 |
B38400 |

inputSpeed :: TerminalAttributes -> BaudRate
withInputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
outputSpeed :: TerminalAttributes -> BaudRate
withOutputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
Terminal operations
sendBreak :: Fd -> Int -> IO ()
drainOutput :: Fd -> IO ()
data QueueSelector

Constructors

InputQueue |
OutputQueue |
BothQueues |

discardData :: Fd -> QueueSelector -> IO ()
data FlowAction

Constructors

SuspendOutput |
RestartOutput |
TransmitStop |
TransmitStart |

controlFlow :: Fd -> FlowAction -> IO ()
Process groups
getTerminalProcessGroupID :: Fd -> IO ProcessGroupID
setTerminalProcessGroupID :: Fd -> ProcessGroupID -> IO ()
Testing a file descriptor
queryTerminal :: Fd -> IO Bool
getTerminalName :: Fd -> IO FilePath
getControllingTerminalName :: IO FilePath
Produced by Haddock version 0.7