From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15242 invoked from network); 12 Aug 2002 11:42:12 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Aug 2002 11:42:12 -0000 Received: (qmail 13980 invoked by alias); 12 Aug 2002 11:42:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17533 Received: (qmail 13968 invoked from network); 12 Aug 2002 11:42:05 -0000 To: zsh-workers@sunsite.dk Subject: Re: read timeout argument || completion of a function In-reply-to: "Oliver Kiddle"'s message of "Mon, 12 Aug 2002 12:13:47 BST." <20020812111347.GA5620@logica.com> Date: Mon, 12 Aug 2002 12:41:37 +0100 Message-ID: <11500.1029152497@csr.com> From: Peter Stephenson 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' and other places which only accept `-X '. 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 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. **********************************************************************