zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: W02jobs.ztst hangs with zsh 5.6.1
Date: Mon, 10 Sep 2018 17:22:51 +0100	[thread overview]
Message-ID: <20180910162253eucas1p19cc5b33c6d6c22226f4d908ca564b7ad~TFnFPnHg12300523005eucas1p1F@eucas1p1.samsung.com> (raw)
In-Reply-To: <1536594632.827723.1503050288.42A44FB8@webmail.messagingengine.com>

On Mon, 10 Sep 2018 15:50:32 +0000
Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Peter Stephenson wrote on Mon, 10 Sep 2018 16:14 +0100:
> > It's unlikely zpty is going to get enough love and attention to be
> > robust enough for what we really need here.
> > 
> > I wonder if there is some replacement we could use that someone might
> > already know about?  The Python pty module looked like it might be
> > usable, but I encountered half a dozen Python-style illogicalities before
> > getting a dozen lines into a programme, so we'll need some existing
> > script to start with.  
> 
> Could you explain what that replacement (in Python or anything else)
> needs to do?  Are you asking for a program that launches ../Src/zsh in a
> pty and then writes the stty(1) 'susp' character to that pty?  (At this
> point the program could just send SIGTSTP directly, too; I'm not sure
> if that's an option.)

As near a direct replacement for ztpy as possible, but basically all it
needs to be able to do is spwan a slave running zsh, write to that, and
read back from it.  You'd have thought that wasn't too hard, but
experience suggests otherwise.

I got some life with the Ruby pty module, based on the example in the
documentation.  I haven't worked out how to get the right file
descriptors in the right place, so this is a non-working exmaple of
particular things we want to do more generically --- i.e. pass in
instructions to read and write, then look at the results returned,
rather than hard wire.

pws


require 'pty'

master, slave = PTY.open
read, write = IO.pipe
::ENV["PS1"] = ""
pid = spawn("zsh", "-fV", "+Z", :in=>read, :out=>slave)
read.close     # we dont need the read
slave.close    # or the slave

write.puts 'print $ZSH_VERSION'
p master.gets

# Write is a normal pipe so this doesn't actually work.
write.puts "stty susp \^z"

write.puts 'sleep 5'
# \C-z: again, this isn't actually going to the terminal.
write.printf "%c", 26
p master.gets
# hoping to see something involving a stopped / suspended message.


  reply	other threads:[~2018-09-10 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180910102119epcas5p384cea9ba5749eb81be99c4f4d85a954e@epcas5p3.samsung.com>
2018-09-10 10:20 ` İsmail Dönmez
2018-09-10 10:32   ` Peter Stephenson
2018-09-10 10:39     ` İsmail Dönmez
2018-09-10 11:19       ` Peter Stephenson
2018-09-10 11:32         ` İsmail Dönmez
2018-09-10 12:46           ` Peter Stephenson
2018-09-10 13:07             ` İsmail Dönmez
2018-09-10 15:14         ` Peter Stephenson
2018-09-10 15:50           ` Daniel Shahaf
2018-09-10 16:22             ` Peter Stephenson [this message]
2018-09-10 16:55               ` Bart Schaefer
2018-09-10 17:40                 ` Peter Stephenson

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='20180910162253eucas1p19cc5b33c6d6c22226f4d908ca564b7ad~TFnFPnHg12300523005eucas1p1F@eucas1p1.samsung.com' \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).