zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Cc: linuxtechguy@gmail.com
Subject: Re: When RPROMPT != RPS1
Date: Wed, 21 Jun 2017 10:16:45 -0700	[thread overview]
Message-ID: <170621101645.ZM9838@torch.brasslantern.com> (raw)
In-Reply-To: <CA+rB6GJmWTeRgQRr7OabGiENq=zWFOKHMGw6i43uuw82TrD_oQ@mail.gmail.com>

On Jun 20,  1:22pm, Jim wrote:
}
} > After switching from walters to say adam, I unset "RPS1",
} > but the right prompt remained.  I then typed
} > "unset RPROMPT" and the right prompt was no longer there.
} 
} I should have checked earlier. I'm seeing the same thing with
} RPS2 and RPROMPT2.

What's going on here is that RPROMPT, RPS1, RROMPT2, and RPS2 always
start out as unset, so assigning to one of each pair does not cause
the second one to magically become set.  Then if you unset any one
that is already unset, nothing happens (including not unsetting the
paired one).

The assumption is that under normal circumstances the user will not
be arbitrarily/randomly switching which name he prefers to use.  The
prompt themes mess with that because they combine code from several
different users.

The reason they start out as unset is explained here:
http://www.zsh.org/mla/workers/2014/msg00128.html

The argument/complaint was that if those parameters have no meaning
in an emulation mode, then they should not be set at all, thereby
allowing scripts in the emulation to use those names any way they
want without triggering the pairing behavior.

I don't have a good suggestion for how to satisfy both constraints.
Anyone?  The parameter initialization code has been broken up into
a few more sections already, maybe there's a way to rearrange these
as well.

} In addition the promptinit function doesn't set RPS2:
} 
}     local +h PS1=$PS1 PS2=$PS2 PS3=$PS3 PS4=$PS4 RPS1=$RPS1

Yeah, I'm not sure why it's done that way; the prompt_bart_setup doc
even says:
    If a fifth color is specified and there is no RPS2, PS2 (PROMPT2)
    is colored and moved to RPS2.  Changes to RPS1/RPS2 are currently
    not reverted when the theme is switched off.

Obviously, though, that "local" command was written before the change
from workers/32337 was applied.


  reply	other threads:[~2017-06-21 17:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 17:08 Jim
2017-06-20 18:22 ` Jim
2017-06-21 17:16   ` Bart Schaefer [this message]
2017-06-22  9:17     ` Peter Stephenson
2017-06-23 20:07       ` Daniel Tameling
2017-06-24  3:37         ` Bart Schaefer
2017-06-24 20:09           ` Daniel Tameling
2017-07-28  2:53             ` Bart Schaefer
2017-07-31 16:24               ` Jim
2017-07-31 18:33                 ` 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=170621101645.ZM9838@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=linuxtechguy@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).