zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH (?): Re: suspend while loop.
Date: Fri, 19 May 2000 08:30:21 +0000	[thread overview]
Message-ID: <1000519083021.ZM282@candle.brasslantern.com> (raw)
In-Reply-To: <200005190743.JAA05852@beta.informatik.hu-berlin.de>

On May 19,  9:43am, Sven Wischnowsky wrote:
} Subject: Re: PATCH (?): Re: suspend while loop.
}
} Bart Schaefer wrote:
} 
} > The thing that most worries me is that zread() can invoke zle, which can
} > invoke shell functions, which ....
} 
} No, it only uses getkey() which doesn't call functions. It's just a
} read-one-char that works while zle is active. But it should be
} possible to avoid the child_unblock() when `izle != 0', I think.

I don't think that's worth the effort and the messiness; `read' is going
to spend the vast majority of its time in the read-one-character loops,
so as long as the signal changes are outside those loops it should be OK.

BTW, I just noticed this:

	echo -n foo | read line
	echo $?
	echo $line

By comparison, bash also gives $? == 1 but NOT $line == foo.

(Why is lack of a trailing newline an error?)

} > Another question is, is there a more generic way to do this [...?]
} 
} We only have to handle builtins that can potentially block
} indefinitely, right?

Well ... there's the "command1 | builtin ; command2" thing where interrupt
kills command1 but not builtin, causing builtin to exit on EOF and thereby
allowing command2 to run.  Ideally the interrupt would affect command2 as
well.  If builtin is a loop or other construct this already works, so the
questions are (1) can any other builtins be used in a pipe, and (2) can
any syntactic construct other than a pipeline produce the same effect.

Given that modules can do just about anything they want, the answer to (1)
is "yes" even if there's currently no example ...

However, that doesn't affect 3.0.8, so I think I'm going to go ahead with
11461 for that release (unless somebody hollers today to stop me).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~2000-05-19  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-19  7:43 Sven Wischnowsky
2000-05-19  8:30 ` Bart Schaefer [this message]
2000-05-19 14:49   ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2000-05-18  8:37 Sven Wischnowsky
2000-05-18 16:53 ` PATCH (?): " 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=1000519083021.ZM282@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --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).