zsh-users
 help / color / mirror / code / Atom feed
* Bug/regression: tt(RANDOM) seed not updating when $RANDOM is used in a pipe
@ 2023-06-28 20:10 Jon Oster
  2023-06-29  2:46 ` Eric Cook
  2023-07-02  7:17 ` Mikael Magnusson
  0 siblings, 2 replies; 10+ messages in thread
From: Jon Oster @ 2023-06-28 20:10 UTC (permalink / raw)
  To: zsh-users

In 5.8.1, $RANDOM seems not to update its state when the command $RANDOM
was used in is piped somewhere. For example:

# echo $RANDOM
18163
# echo $RANDOM
23472
# echo $RANDOM
27685
# echo $RANDOM|cat
10178
# echo $RANDOM|cat
10178
# echo $RANDOM
10178
# echo $RANDOM
17862

This is new behaviour since I upgraded from 5.4.2 to 5.8.1. At first I
thought that it might be somehow related to multios, but the result is
the same with multios on or off. So, I did a bisect, and discovered that
faf0035e532cde45528806e7a05ad28a0ab7c0fb[1] is the commit that introduced
this behaviour.

Is this considered a bug? Or is it intended behaviour? Personally, I'd
argue it's a bug. Unfortunately, my C isn't good enough to try to fix and
submit a patch myself, but I tried to make this bug report as helpful as
possible.

[1] https://sourceforge.net/p/zsh/code/ci/faf0035e532cde45528806e7a05ad28a0ab7c0fb/

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

end of thread, other threads:[~2023-07-02  7:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28 20:10 Bug/regression: tt(RANDOM) seed not updating when $RANDOM is used in a pipe Jon Oster
2023-06-29  2:46 ` Eric Cook
2023-06-29  5:42   ` Bart Schaefer
2023-06-29 14:41     ` Ray Andrews
2023-06-29 14:56     ` Roman Perepelitsa
2023-06-29 17:53       ` Mikael Magnusson
2023-06-29 18:15         ` Roman Perepelitsa
2023-06-29 23:41           ` Bart Schaefer
2023-07-02  7:17 ` Mikael Magnusson
2023-07-02  7:29   ` Roman Perepelitsa

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