From 8e6d77407e7830818b6f8a8acfba04b203ce311d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pier-Luc=20Th=C3=A9riault?= Date: Fri, 26 Dec 2025 15:35:06 -0500 Subject: [PATCH 1/2] Use tty_write to write piped input to tty --- src/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index efda859..1c486b5 100644 --- a/src/tty.c +++ b/src/tty.c @@ -2639,7 +2639,7 @@ int tty_connect(void) else if (ret > 0) { // Forward to tty device - ret = write(device_fd, &input_char, 1); + ret = tty_write(device_fd, &input_char, 1); if (ret < 0) { tio_error_printf("Could not write to serial device (%s)", strerror(errno)); From d1271c8612d23d8ae36783e83ffbb697013b9967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pier-Luc=20Th=C3=A9riault?= Date: Tue, 30 Dec 2025 14:07:34 -0500 Subject: [PATCH 2/2] Send remainder of tty_buffer before exiting for piped input --- src/tty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tty.c b/src/tty.c index 1c486b5..16a1067 100644 --- a/src/tty.c +++ b/src/tty.c @@ -2668,6 +2668,7 @@ int tty_connect(void) // Exit if piped input if (interactive_mode == false) { + tty_sync(device_fd); exit(EXIT_SUCCESS); }