zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: Re: pws-18: Multiline cut'n'paste - second go.
Date: Fri, 14 May 1999 14:13:49 +0200	[thread overview]
Message-ID: <9905141213.AA46939@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Andrej Borsenkow""'s message of "Fri, 14 May 1999 14:15:16 DFT." <003e01be9df2$a9a1c3f0$21c9ca95@mow.siemens.ru>

"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
{<RETURN> before the paste, and }<RETURN> 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 <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-05-14 12:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-14 10:15 Andrej Borsenkow
1999-05-14 12:13 ` Peter Stephenson [this message]
1999-05-29  7:51   ` 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=9905141213.AA46939@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.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).