zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Misc. zpty tweaks, plus commentary
Date: Sun, 5 Nov 2000 01:59:58 +0000	[thread overview]
Message-ID: <1001105015958.ZM7352@candle.brasslantern.com> (raw)
In-Reply-To: <1001104232950.ZM3561@candle.brasslantern.com>

On Nov 4, 11:29pm, I wrote:
}
} `zpty -w' already was able to stream into the pty (even though that's
} not documented); e.g. `zpty -w foo < file' writes the entire contents
} of the file to the pty [...] Now `zpty -r foo' can stream the output
} as well.  Unfortunately, it's still not possible to do both at once.
}
} The problem is that whenever zsh forks a builtin, it closes all
} descriptors numbered higher than 10, which includes the master pty
} descriptor.

Although a C-code-level fix would be preferable, a workaround has just
occurred to me:  Using a subshell will prevent the descriptors from
being closed.  So with 13116 applied, you should be able to do:

    zpty -b foo cat
    yes blah | (zpty -w foo) &
    (zpty -r foo) | less
    zpty -d foo

This reveals that still another remaining problem is that `zpty -w' on a
blocking pty doesn't stop when the process on the pty is killed.  There
doesn't seem to be any simple fix for this; write() itself is blocked,
and does not get interrupted with SIGPIPE as would normally occur.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2000-11-05  2:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-04 23:29 Bart Schaefer
2000-11-05  1:59 ` Bart Schaefer [this message]
2000-11-05  4:35 ` Bart Schaefer
2000-11-05  9:12   ` PATCH: Zpty cleanup (merge 13061 with 13116) Bart Schaefer
2000-11-08 14:03     ` read_poll " Andrej Borsenkow
2000-11-08 10:20 Sven Wischnowsky
2000-11-08 10:42 ` Andrej Borsenkow
2000-11-08 14:09 read_poll " Sven Wischnowsky
2000-11-08 14:46 ` Andrej Borsenkow
2000-11-08 15:58   ` PATCH: read_poll " Bart Schaefer
2000-11-08 17:00     ` Bart Schaefer
2000-11-08 19:10     ` Bug in cygwin with select and master pty Andrej Borsenkow
2000-11-13 10:21 PATCH: Misc. zpty tweaks, plus commentary Sven Wischnowsky
2000-11-13 16:20 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1001105015958.ZM7352@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).