vgrep-0.2.2.0: A pager for grep

Safe HaskellNone
LanguageHaskell2010

Vgrep.App.Internal

Synopsis

Documentation

viewportHack :: IO Viewport Source #

We need the viewport in order to initialize the app, which in turn will start Vty. To resolve this circular dependency, we start once Vty in order to determine the display viewport, and shut it down again immediately.

withEvThread :: Consumer Event IO () -> Vty -> VgrepT s IO a -> VgrepT s IO a Source #

Spawns a thread parallel to the action that listens to Vty events and redirects them to the Consumer.

withVty :: (Vty -> IO a) -> IO a Source #

Passes a Vty instance to the action and shuts it down properly after the action finishes. The inputFd and outputFd handles are connected to /dev/tty (see tty).

withVgrepVty :: (Vty -> VgrepT s IO a) -> VgrepT s IO a Source #

Like withVty, but lifted to VgrepT s IO.

withTty :: (Fd -> IO a) -> IO a Source #

Passes two file descriptors for read and write access to /dev/tty to the action, and closes them after the action has finished.

withVgrepTty :: (Fd -> VgrepT s IO a) -> VgrepT s IO a Source #

Like withTty, but lifted to VgrepT s IO.

tty :: IO Fd Source #

Opens /dev/tty in Read/Write mode. Should be connected to the stdin and stdout of a GUI process (e. g. Vty).