Fix issue that output-delay doen't work in non-interactive mode

This commit is contained in:
yabu76 2025-12-30 20:58:06 +09:00
parent 2b0e674ee4
commit 5045ca1768

View file

@ -2736,7 +2736,7 @@ int tty_connect(void)
{ {
while (true) while (true)
{ {
int ret = read(pipefd[0], &input_char, 1); int ret = read(pipefd[0], input_buffer, BUFSIZ);
if (ret < 0) if (ret < 0)
{ {
tio_error_printf("Could not read from pipe (%s)", strerror(errno)); tio_error_printf("Could not read from pipe (%s)", strerror(errno));
@ -2745,7 +2745,7 @@ int tty_connect(void)
else if (ret > 0) else if (ret > 0)
{ {
// Forward to tty device // Forward to tty device
ret = write_poll(device_fd, &input_char, 1, WRITE_POLL_FOREVER); ret = tty_write(device_fd, input_buffer, ret);
if (ret < 0) if (ret < 0)
{ {
tio_error_printf("Could not write to serial device (%s)", strerror(errno)); tio_error_printf("Could not write to serial device (%s)", strerror(errno));