zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <borsenkow.msk@sni.de>
To: "Sven Wischnowsky" <wischnow@informatik.hu-berlin.de>,
	<zsh-workers@sunsite.auc.dk>
Subject: RE: pws-22: killing the ZSH loops problem
Date: Fri, 18 Jun 1999 19:33:18 +0400	[thread overview]
Message-ID: <000a01beb99f$e3c28fb0$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <199906180855.KAA12796@beta.informatik.hu-berlin.de>

>
> (Btw. `foo | while ...' can be ^C'ed because we have the `foo' to find
> that out. This means that we could make normal loops be ^C'able by
> forking of a sub-shell for every loop and let the sub-shell do
> nothing. Then ^C would SIGINT the sub-shell and the parent shell would
> be notified about this -- but this is really ugly isn't it? Or should
> we? But that would be an extra fork on every shell construct...)
>

We need it only if MONITOR is set and this is typically (if not exclusively)
interactive shells. Unfortunately, with new completion, we use loops heavily.
OTOH exactly with new completion in mind, there must be some way to kill it. It
is not good, when completion function hangs in some loop without any possibility
to get out. And it just occured to me - is it possible to kill/stop/resume shell
function?

> And another `btw.': comparison with bash shows that it has the same
> problem ^C'ing such commands in loops and behaves like zsh. But it
> can't even correctly stop such loops.
>
>

I looked at how it is implemented in ksh and csh on our system.

csh:

resets process group for every external command. It is impossible to ^C loop
(for the same reason as in Zsh). It is possible to ^Z it - but it makes loop
disapper. After fg only the last started external command is brought in
foreground. When it exits, loop effectively terminates. Looks horribly broken.

ksh:

does not reset process group at all. Ignores ^Z (TSTP). It is possible to ^C
loop (ksh cathes INT). It is impossible to ^Z loop because TSTP remains ignored
by child (I suspect actually a bug in ksh - it should reset TSTP to default
before exec'ing)

So - assuming, that we won't reset process group - is it possible to make zsh
catch INT (QUIT?) and TSTP and behave nicely?

/andrej


  reply	other threads:[~1999-06-18 15:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-18  8:55 Sven Wischnowsky
1999-06-18 15:33 ` Andrej Borsenkow [this message]
1999-06-18 16:44   ` Bart Schaefer
1999-06-21  7:08     ` Andrej Borsenkow
1999-06-21 15:55       ` Bart Schaefer
1999-06-21 16:14         ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
1999-06-21 11:29 Sven Wischnowsky
1999-06-17  9:23 Sven Wischnowsky
1999-06-16  9:09 Andrej Borsenkow
1999-06-16  8:43 Andrej Borsenkow
1999-06-15 16:45 Andrej Borsenkow
1999-06-16 15:14 ` Peter Stephenson
1999-06-16 17:16   ` 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='000a01beb99f$e3c28fb0$21c9ca95@mow.siemens.ru' \
    --to=borsenkow.msk@sni.de \
    --cc=wischnow@informatik.hu-berlin.de \
    --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).