zsh-users
 help / color / mirror / code / Atom feed
* Re: coproc tutorial (Re: questions)
@ 1999-10-11 10:45 Sven Wischnowsky
  1999-10-11 12:55 ` Thomas Köhler
  1999-10-11 17:58 ` Functions/Misc/nslookup (Re: coproc tutorial (Re: questions)) Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Sven Wischnowsky @ 1999-10-11 10:45 UTC (permalink / raw)
  To: zsh-users


Chris Hansen wrote:

> #!/bin/zsh -i
> 
> coproc /usr/bin/nslookup
> 
> while true; do
> 	TEST=">"
> 	NSLOUT=" "
> 	while [[ $TEST != $NSLOUT ]] ; do
> 		print -n $NSLOUT
> 		read -pk NSLOUT
> 	done
> 	read 'QUERY?>'
> 	print -p $QUERY
> done

3.1.6-pws-something (at least the latest pws-6) has Functions/Misc/nslookup
which uses `vared' to read the user input, thus allowing command line
editing. Together with the new completion system this function will
also give you completion *inside* nslookup (and not only nslookup's
arguments).

To workers: seems like noone found this interesting enough to improve
the code I hacked up. Maybe sometime we could write a generic function 
for this task...

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Functions/Misc/nslookup (Re: coproc tutorial (Re: questions))
@ 1999-10-12  9:32 Sven Wischnowsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sven Wischnowsky @ 1999-10-12  9:32 UTC (permalink / raw)
  To: zsh-users


Oliver Kiddle wrote:

> Bart Schaefer wrote:
> 
> > This doesn't work for me because the real nslookup begins block-buffering
> > its output when stdout is not a tty.  Furthermore, if I type ^C while the
> > nslookup function is running, the entire shell exits.
> 
> I've had trouble getting it to work as well which I assumed was to do
> with it not having a tty. I tried the same trick with timedc and mailx
> aswell with varying problems. Are there any tricks we can do so that the
> programs think they have a terminal because it is potentially a very
> useful idea? If we can get it to work reliably a generic function for
> the purpose as Sven suggested would be a good idea. Can anyone think of
> any other programs which it might be useful for?

How about adding a module that offers a builtin that behaves like
a mixture of `coproc' and `eval' (i.e. arguments used as by `eval',
otherwise like `coproc') but executes the stuff in a pty?

This could also support options for simplifying parsing the output (so 
that we don't have to read one character after another but instead can 
read them in blocks, making things faster).

Any portable-pty-code experts around here?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~1999-10-12  9:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-11 10:45 coproc tutorial (Re: questions) Sven Wischnowsky
1999-10-11 12:55 ` Thomas Köhler
1999-10-11 17:58 ` Functions/Misc/nslookup (Re: coproc tutorial (Re: questions)) Bart Schaefer
1999-10-12  8:54   ` Oliver Kiddle
1999-10-12  9:04     ` Thomas Koehler
1999-10-12  9:32 Sven Wischnowsky

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).