zsh-workers
 help / color / mirror / code / Atom feed
* Bug: reading from tty inside process substitution
@ 2023-11-12 15:59 Mark J. Reed
  2023-11-12 18:09 ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Mark J. Reed @ 2023-11-12 15:59 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

The below code hangs after reading the line from the terminal:

    read foo < <(read bar </dev/tty; echo $bar)

The actual use case I ran into this involved a select, which also hangs
after item selection:

    read foo < <(select item in a b c; do break; done </dev/tty >/dev/tty
2>&1; echo $item)

Both commands work as intended in both bash and ksh.

If I replace the outer `read` with a command substitution, it works in zsh
as well (it started out as `read` because I was getting multiple values out
of the `select`ed line).

I'm running zsh 5.9, tested on macOS 13.6 and 14.0 and Ubuntu 22.04.3
-- 
Mark J. Reed <markjreed@gmail.com>

[-- Attachment #2: Type: text/html, Size: 1061 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-11-18 23:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-12 15:59 Bug: reading from tty inside process substitution Mark J. Reed
2023-11-12 18:09 ` Bart Schaefer
2023-11-12 21:50   ` Bart Schaefer
2023-11-15  3:33   ` Bart Schaefer
2023-11-15  4:42     ` Bart Schaefer
2023-11-15  5:00       ` Bart Schaefer
2023-11-16  4:58         ` Bart Schaefer
2023-11-17  1:27           ` [PATCH] reading from large or "infinite" source in multio Bart Schaefer
2023-11-18 23:24             ` Bart Schaefer
2023-11-16  2:35       ` [PATCH] reading from tty inside process substitution Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).