From 8a9c4412edfb87aeda6628efc030bce53bfe3f1b Mon Sep 17 00:00:00 2001 From: huwwa Date: Tue, 5 May 2026 02:21:32 +0300 Subject: [PATCH] shell: check process termination before closing --- modes/shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modes/shell.c b/modes/shell.c index 776e302..ad78752 100644 --- a/modes/shell.c +++ b/modes/shell.c @@ -2400,7 +2400,8 @@ static void shell_read_cb(void *opaque) len = read(s->pty_fd, buf, sizeof(buf)); if (len <= 0) { - shell_close(s); + if (s->pid == -1) + shell_close(s); return; }