feat: Improve POSIX piped input handling

Refactored the POSIX piped input handling to avoid redirecting stdin.
Instead, it now directly opens and reads from /dev/tty for keyboard input
when stdin is piped, allowing applications to process piped data while
still receiving interactive keyboard events.

This addresses the TODO comment in ScreenInteractive::InstallPipedInputHandling().
This commit is contained in:
ArthurSonzogni
2025-08-17 19:40:20 +02:00
parent b0ba518d85
commit 4b0d0984a5
2 changed files with 18 additions and 21 deletions

View File

@@ -147,6 +147,8 @@ class ScreenInteractive : public Screen {
// Piped input handling state (POSIX only)
bool handle_piped_input_ = true;
// File descriptor for /dev/tty, used for piped input handling.
int tty_fd_ = -1;
// The style of the cursor to restore on exit.
int cursor_reset_shape_ = 1;