Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.81 KB

README.md

File metadata and controls

49 lines (31 loc) · 1.81 KB

hs-term-emulator

https://twitter.com/bitconnordev

This is a Terminal Emulator (like xterm) implemented entirely in Haskell.

There are two packages:

  1. hs-term-emulator: This is a "pure" package that does no Input/Output and has no actual GUI.

    It provides a data structure representing the state of a terminal (See System.Terminal.Emulator.Term), and functions for parsing the terminal output bytestream and updating the 'Term' datastructure.

    It also has functions for translating user KeyPress actions from a typical physical keyboard into the correct escape sequences that should be fed back into the terminal pty.

  2. hs-sdl-term-emulator: A proof-of-concept implementation of a real usable terminal.

    This builds upon the previous package, and uses the sdl2 package to create a desktop window that renders the contents of the terminal. It also listens to keyboard presses and sends them back into the terminal.

Screenshots

screenshot_shell_01

screenshot_htop_01

screenshot_vim_01

Misc Development Tricks

Here is a good ghci trick:

:def! R \_ -> Prelude.return (":!clear\n:r\n:main")
:R

Running cabal-fmt:

$ mkdir -p ./.cabal/bin
$ cabal v2-install cabal-fmt --installdir=./.cabal/bin --overwrite-policy=always
$ ./.cabal/bin/cabal-fmt --version