Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] reading from tty inside process substitution
- X-seq: zsh-workers 52309
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] reading from tty inside process substitution
- Date: Wed, 15 Nov 2023 18:35:17 -0800
- Archived-at: <https://zsh.org/workers/52309>
- In-reply-to: <CAH+w=7abshTC3bJC6YRJOszsyzJEHbBLYZafzdGd4p8J8LK5xg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAA=-s3xCf4wx826U8jEjO_j5-1kcTi8v2=VZPiabKMo-meKq0Q@mail.gmail.com> <CAH+w=7ZztRXt7R9fDK=yb1=fcvjwjiUGo98j73BgBG7NzWE+iw@mail.gmail.com> <CAH+w=7ZVJeo==zJjUi7OaUWt5nRqhif2ApTk5z5a0PD9mONc4Q@mail.gmail.com> <CAH+w=7abshTC3bJC6YRJOszsyzJEHbBLYZafzdGd4p8J8LK5xg@mail.gmail.com>
On Tue, Nov 14, 2023 at 8:42 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> (This patch may not apply cleanly due to gmail ... I'll prepare a
> proper one if deemed OK.)
Taking silence as assent ...
diff --git a/Src/exec.c b/Src/exec.c
index 285d2c5ad..97823760f 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2309,7 +2309,7 @@ closemn(struct multio **mfds, int fd, int type)
for (i = 0; i < mn->ct; i++)
while ((len = read(mn->fds[i], buf, TCBUFSIZE)) != 0) {
if (len < 0) {
- if (errno == EINTR)
+ if (errno == EINTR && !isatty(mn->fds[i]))
continue;
else
break;
@@ -5096,7 +5096,7 @@ getpipe(char *cmd, int nullexec)
procsubstpid = pid;
return pipes[!out];
}
- entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL);
+ entersubsh(ESUB_ASYNC|ESUB_PGRP|ESUB_NOMONITOR, NULL);
redup(pipes[out], out);
closem(FDT_UNUSED, 0); /* this closes pipes[!out] as well */
cmdpush(CS_CMDSUBST);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author