zsh-workers
 help / color / mirror / code / Atom feed
* minor 'select' snag
@ 2016-02-14 23:05 Martijn Dekker
  2016-02-15 12:48 ` Peter Stephenson
  2016-02-15 16:46 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: Martijn Dekker @ 2016-02-14 23:05 UTC (permalink / raw)
  To: zsh-workers

I'm analysing the behaviour of 'select' in various shells and found a a
way in which it's different in zsh from bash, ksh93 and {pd,m}ksh.

If a user presses Ctrl-D (EOF) within a 'select' loop, the REPLY
variable is left unchanged on zsh. On the other shells with 'select', it
is cleared, which is the same behaviour as 'read' (including 'read' on
zsh) and seems more logical. This makes it possible to decide whether to
continue after the loop by testing for the emptiness of $REPLY without
having to initialise it before entering the loop. It would be nice if
this worked the same way on zsh.

Thanks,

- M.

(Note of possible side interest: My experimental cross-platform shell
library, "modernish" <http://github.com/modernish/modernish> has a
module providing its own 'select' implementation for POSIX shells. It
mimics native implementations as closely as possible. On bash, *ksh and
zsh, the module does nothing except a check for a particular shell bug.
End result: all POSIX shells can use 'select'. There are just some minor
differences to account for, including the above-mentioned one.)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-26 18:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-14 23:05 minor 'select' snag Martijn Dekker
2016-02-15 12:48 ` Peter Stephenson
2016-02-15 17:01   ` Bart Schaefer
2016-09-26 16:59   ` Martijn Dekker
2016-02-15 16:46 ` Bart Schaefer

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).