From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29813 invoked from network); 14 May 1999 12:38:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 May 1999 12:38:43 -0000 Received: (qmail 11541 invoked by alias); 14 May 1999 12:38:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6286 Received: (qmail 11518 invoked from network); 14 May 1999 12:38:18 -0000 Message-Id: <9905141213.AA46939@ibmth.df.unipi.it> To: "ZSH workers mailing list" Subject: Re: pws-18: Multiline cut'n'paste - second go. In-Reply-To: ""Andrej Borsenkow""'s message of "Fri, 14 May 1999 14:15:16 DFT." <003e01be9df2$a9a1c3f0$21c9ca95@mow.siemens.ru> Date: Fri, 14 May 1999 14:13:49 +0200 From: Peter Stephenson "Andrej Borsenkow" wrote: > Now Zsh correctly handles multiline input in *single* command (that is, with > PS2) - but not, when every line is a separate command. I understand the problem (tell me I'm wrong, go on), but I don't really see what can be done about it. The TCSETSW comes from settyinfo(), probably via tcsetattr(SHTTY, TCSADRAIN, ...), which is equivalent. When zle is being used, the terminal has to be set back to it's ordinary mode for ordinary commands to run, because there's no way it can know what's being run, which will cause this; the OSes with this problem simply don't seem to allow `change the terminal modes without screwing up typeahead' --- if we could find a way of doing that we're home and dry. With the previous patch, we delayed changing the modes till the end of parsing for one complete set of input because nothing got executed in that time, but now we've got a complete set of input, time's up. The only half way out I can see would be to remember the terminal setting and not change it until an external command, or an internal command doing I/O, is started. That's a big and bug-prone thing to do, and if the pasted commands call something external then you're out of luck anyway. Maybe someone can think of a way round. There are workarounds, although you've probably thought of those: type { before the paste, and } afterwards, then it's all done inside PS2; or temporarily turning off zle during pasting. Even that last can't be automated, because if zle is running when the, er, paste hits the fan, then you will at some point need to switch the terminal modes for running the commands. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy