ErichDonGubler / termion

A bindless library for controlling terminals/TTY.
MIT License
4 stars 1 forks source link

Windows support: use a struct for general library init and cleanup #11

Open ErichDonGubler opened 6 years ago

ErichDonGubler commented 6 years ago

According to the discussion on https://github.com/ErichDonGubler/termion/issues/8, we will want to refactor this library to expose MOST of its API through a new struct that will control initialization and cleanup of any terminal state that is needed to guarantee that the terminal is using ANSI-compatible features.

The motivation for this is that, by default, Windows 10's cmd.exe does NOT enable ANSI escape processing. In order to be a good citizen with terminal state, we need to provide an ergonomic facility for ensuring that terminal state is reset correctly when this library is done being used.