|
CPGen
C++ project generator
|
RAII wrapper that manages terminal raw mode for the TUI. More...
#include <termios.h>#include <unistd.h>#include <csignal>#include <cstdio>#include <cstdlib>

Go to the source code of this file.
Classes | |
| class | Terminal |
| RAII raw-mode terminal handler. More... | |
RAII wrapper that manages terminal raw mode for the TUI.
Constructing a Terminal puts stdin into raw mode (no line buffering, no echo) so that key presses can be read one character at a time. The destructor unconditionally restores the original terminal settings.
Signal handlers for SIGINT and SIGTERM are installed to guarantee that the terminal is restored even when the user presses Ctrl+C or the process is killed externally.