zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: read timeout argument || completion of a function
Date: Mon, 12 Aug 2002 12:41:37 +0100	[thread overview]
Message-ID: <11500.1029152497@csr.com> (raw)
In-Reply-To: "Oliver Kiddle"'s message of "Mon, 12 Aug 2002 12:13:47 BST." <20020812111347.GA5620@logica.com>

Oliver Kiddle wrote:
> On Mon, Aug 12, 2002 at 12:43:08PM +0200, Bruno Bonfils wrote:
> > > On Aug 11, 10:54pm, Bruno Bonfils wrote:
> > > } i'm very surprised to observe there isn't timeout argument for
> > > } read builtin function.
>  
> > So, do you think it's difficult to add this argument to read builtin
> > function ? 
> 
> That is probably for Peter to say.

Two issues:

(1) Getting keyboard polling to work on both UNIX and Cygwin was a
nightmare, so the code is quite complicated.  This makes adding timeouts
in the case where the input is a tty more difficult, though still
entirely feasible.  (Even on Solaris I have problems with both select()
and poll() that they won't tell you about lookahead when the tty goes
from canonical to raw mode, so it will have to be done via termio
timeouts in this case, while for non-tty input you are stuck with
select/poll, which probably means bringing in the core of zsh/zselect
and leaving only the builtin itself in the module.  In addition, I am
more and more missing a direct interface to system read.)

(2) We took -t for this (test) and we really need to make -t with a
number work for timeouts for compatibility with everyone else.  You
don't normally give a numeric parameter to read (though in fact it works),
so this ought to be possible.  However, adding optional numeric
arguments will have to wait for the current horrific handling of option
arguments (dating from year zero and looking like it) to be tidied up.
(It's not just horrific internally in some cases:  I've a vague memory
there are places which only accept `-X<arg>' and other places which only
accept `-X <arg>'.  It's no surprise that many modules handle option
arguments using their own code.)

I have been waiting hopefully for other people to attempt these tasks,
but I will obviously be waiting till doomsday.  (2) will have to come
first (reverse zsh logic).

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


  reply	other threads:[~2002-08-12 11:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-11 20:54 Bruno Bonfils
2002-08-12  5:45 ` Bart Schaefer
2002-08-12 10:43   ` Bruno Bonfils
2002-08-12 11:13     ` Oliver Kiddle
2002-08-12 11:41       ` Peter Stephenson [this message]
2002-08-12 15:12         ` Bart Schaefer
2002-08-12 15:21     ` 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=11500.1029152497@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.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).