|
RADLib
RADical C++ application framework
|
PTY-backed terminal session that feeds output into TerminalBuffer. More...
#include <RADTerminal.h>
Public Member Functions | |
| PtyTerminalSession (std::function< void()> changed={}) | |
| Creates a terminal session and optional change callback. More... | |
| ~PtyTerminalSession () | |
| Stops the session and joins the reader thread. More... | |
| PtyTerminalSession (const PtyTerminalSession &)=delete | |
| Terminal sessions own a PTY and are not copied. More... | |
| PtyTerminalSession & | operator= (const PtyTerminalSession &)=delete |
| Terminal sessions own a PTY and are not copied. More... | |
| bool | start (const std::string &shell={}, uint16_t rows=30, uint16_t columns=120) |
| Starts shell in a PTY sized rows by columns. More... | |
| void | stop () |
| Stops the child process and reader thread. More... | |
| bool | isRunning () const |
| Returns true while the PTY session is active. More... | |
| bool | resize (uint16_t rows, uint16_t columns) |
| Resizes the PTY and terminal buffer. More... | |
| bool | isAlternateScreen () const |
| Returns true when the terminal is using its alternate screen. More... | |
| TerminalCursor | cursor () const |
| Returns current terminal cursor state. More... | |
| void | writeInput (std::string_view input) |
| Writes user input bytes to the PTY. More... | |
| std::vector< TerminalLine > | snapshot () const |
| Returns a copy of visible terminal lines. More... | |
| std::string | plainText () const |
| Returns visible terminal text without color metadata. More... | |
PTY-backed terminal session that feeds output into TerminalBuffer.
|
explicit |
Creates a terminal session and optional change callback.
| RADUi::PtyTerminalSession::~PtyTerminalSession | ( | ) |
Stops the session and joins the reader thread.
|
delete |
Terminal sessions own a PTY and are not copied.
| TerminalCursor RADUi::PtyTerminalSession::cursor | ( | ) | const |
Returns current terminal cursor state.
| bool RADUi::PtyTerminalSession::isAlternateScreen | ( | ) | const |
Returns true when the terminal is using its alternate screen.
| bool RADUi::PtyTerminalSession::isRunning | ( | ) | const |
Returns true while the PTY session is active.
|
delete |
Terminal sessions own a PTY and are not copied.
| std::string RADUi::PtyTerminalSession::plainText | ( | ) | const |
Returns visible terminal text without color metadata.
| bool RADUi::PtyTerminalSession::resize | ( | uint16_t | rows, |
| uint16_t | columns | ||
| ) |
Resizes the PTY and terminal buffer.
| std::vector<TerminalLine> RADUi::PtyTerminalSession::snapshot | ( | ) | const |
Returns a copy of visible terminal lines.
| bool RADUi::PtyTerminalSession::start | ( | const std::string & | shell = {}, |
| uint16_t | rows = 30, |
||
| uint16_t | columns = 120 |
||
| ) |
Starts shell in a PTY sized rows by columns.
| void RADUi::PtyTerminalSession::stop | ( | ) |
Stops the child process and reader thread.
| void RADUi::PtyTerminalSession::writeInput | ( | std::string_view | input | ) |
Writes user input bytes to the PTY.