zsh-workers
 help / color / mirror / code / Atom feed
* RPS* and RPROMPT* are no longer tied since zsh 5.0.6
@ 2021-11-24 10:03 Marc Cornellà
  2021-12-01  6:32 ` Daniel Shahaf
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Cornellà @ 2021-11-24 10:03 UTC (permalink / raw)
  To: zsh-workers

Hi all,

doing some testing I've found that, when either RPS1 or RPROMPT are
unset (but not both), changes in one of them are not reflected in the
other. The same happens with RPS2 and RPROMPT2.
The same does not happen with PS* and PROMPT*.

% zsh_test_versions 'RPS1=abcd; echo RPS1=$RPS1 RPROMPT=$RPROMPT'    #
function in https://github.com/mcornella/dotfiles/blob/4bf802f6/functions#L78-L118
4.3.11: RPS1=abcd RPROMPT=abcd
4.3.12: RPS1=abcd RPROMPT=abcd
4.3.13: RPS1=abcd RPROMPT=abcd
4.3.14: RPS1=abcd RPROMPT=abcd
4.3.15: RPS1=abcd RPROMPT=abcd
4.3.16: RPS1=abcd RPROMPT=abcd
4.3.17: RPS1=abcd RPROMPT=abcd
5.0.0: RPS1=abcd RPROMPT=abcd
5.0.1: RPS1=abcd RPROMPT=abcd
5.0.2: RPS1=abcd RPROMPT=abcd
5.0.3: RPS1=abcd RPROMPT=abcd
5.0.4: RPS1=abcd RPROMPT=abcd
5.0.5: RPS1=abcd RPROMPT=abcd
5.0.6: RPS1=abcd RPROMPT=
5.0.7: RPS1=abcd RPROMPT=
5.0.8: RPS1=abcd RPROMPT=
5.1: RPS1=abcd RPROMPT=
5.1.1: RPS1=abcd RPROMPT=
5.2: RPS1=abcd RPROMPT=
5.3: RPS1=abcd RPROMPT=
5.3.1: RPS1=abcd RPROMPT=
5.4: RPS1=abcd RPROMPT=
5.4.1: RPS1=abcd RPROMPT=
5.4.2: RPS1=abcd RPROMPT=
5.5: RPS1=abcd RPROMPT=
5.5.1: RPS1=abcd RPROMPT=
5.6: RPS1=abcd RPROMPT=
5.6.1: RPS1=abcd RPROMPT=
5.6.2: RPS1=abcd RPROMPT=
5.7: RPS1=abcd RPROMPT=
5.7.1: RPS1=abcd RPROMPT=
5.8: RPS1=abcd RPROMPT=
master: RPS1=abcd RPROMPT=

I can work around that, but should this be considered a bug or is this intended?

--
Marc Cornellà


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

* Re: RPS* and RPROMPT* are no longer tied since zsh 5.0.6
  2021-11-24 10:03 RPS* and RPROMPT* are no longer tied since zsh 5.0.6 Marc Cornellà
@ 2021-12-01  6:32 ` Daniel Shahaf
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Shahaf @ 2021-12-01  6:32 UTC (permalink / raw)
  To: Marc Cornellà; +Cc: zsh-workers

Marc Cornellà wrote on Wed, Nov 24, 2021 at 11:03:58 +0100:
> doing some testing I've found that, when either RPS1 or RPROMPT are
> unset (but not both), changes in one of them are not reflected in the
> other. The same happens with RPS2 and RPROMPT2.
> The same does not happen with PS* and PROMPT*.
> 
> % zsh_test_versions 'RPS1=abcd; echo RPS1=$RPS1 RPROMPT=$RPROMPT'    #
> function in https://github.com/mcornella/dotfiles/blob/4bf802f6/functions#L78-L118
> 4.3.11: RPS1=abcd RPROMPT=abcd
> 5.0.5: RPS1=abcd RPROMPT=abcd
> 5.0.6: RPS1=abcd RPROMPT=
> 5.8: RPS1=abcd RPROMPT=
> master: RPS1=abcd RPROMPT=
> 

Thanks.  Bisects to 32337.  (That post refers to another thread without
identifying it.  I think the referenced thread is 32158.)

> I can work around that, but should this be considered a bug or is this intended?

Looks like a bug to me.  The two Param's share the param::u.data member,
so once both are set changes to one are reflected in the other.
However, they are both initialized with PM_UNSET.  Presumably, setting
either doesn't remove the PM_UNSET flag from the other, and then the
presence of PM_UNSET causes the value not to be used, even though it's
non-NULL.

diff --git a/Test/D01prompt.ztst b/Test/D01prompt.ztst
index 3fb27e620..6879e6fd1 100644
--- a/Test/D01prompt.ztst
+++ b/Test/D01prompt.ztst
@@ -257,3 +257,9 @@
     ZTST_skip='Missing terminfo module or non-colour terminal'
   fi
 0:Equivalence of terminal colour settings (background colour)
+
+ (RPS1=foo; echo $RPS1 $RPROMPT)
+ (RPS2=bar; echo $RPS2 $RPROMPT2)
+-fD:RPS1 and RPROMPT are aliases (regression from 5.0.6) (workers/49600)
+>foo foo
+>bar bar


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

end of thread, other threads:[~2021-12-01  6:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 10:03 RPS* and RPROMPT* are no longer tied since zsh 5.0.6 Marc Cornellà
2021-12-01  6:32 ` Daniel Shahaf

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