From: Arseny Maslennikov <ar@cs.msu.ru>
To: zsh-workers@zsh.org
Subject: (ping) Re: [PATCH 2/2] promptinit: Fix prompt cleanups
Date: Thu, 18 Feb 2021 16:03:31 +0300 [thread overview]
Message-ID: <YC5lo5lOaFnc+3CN@cello> (raw)
In-Reply-To: <20210125081625.3193714-2-ar@cs.msu.ru>
[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]
On Mon, Jan 25, 2021 at 11:16:25AM +0300, Arseny Maslennikov wrote:
> The Zsh documentation at Doc/Zsh/contrib, paragraph 26.6.4 "Writing
> Themes", says:
>
> Declare cleanup
>
> If your function makes any other changes that should be undone when
> the theme is disabled, your setup function may call
>
> prompt_cleanup command
>
> where command should be suitably quoted. If your theme is ever
> disabled or replaced by another, command is executed with eval. You
> may declare more than one such cleanup hook.
>
> The promptinit framework fails to apply cleanup commands of the current
> theme on any theme change other than "prompt restore", as well as when
> invoking setup functions of a certain $theme as an implementation detail
> of `prompt -[hp] $theme'.
>
> This problem was previously brought up in zsh-users/23314, to no avail.
>
> We fix it in the following way, hopefully without breaking compatibility:
> * Rename zstyle `cleanup' on the context `:prompt-theme' to `restore'
> everywhere but in prompt_cleanup(). It is only used as a restore
> mechanism now.
> * Ensure prompt_cleanup() continues to store its command list in the
> `cleanup' style.
> * Clean up before theme switch at the end of set_prompt().
> * Prepend every use of prompt_*_setup (which might modify the shell
> state in ways that require cleanup) with a cleanup run.
> * Adjust `prompt restore' to do both parts of the newly split restore
> mechanism, cleanup first.
> ---
> Functions/Prompts/prompt_restore_setup | 1 +
> Functions/Prompts/promptinit | 43 ++++++++++++++++++--------
> 2 files changed, 31 insertions(+), 13 deletions(-)
Could someone please look at this series?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-02-18 13:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 8:16 [PATCH 1/2] promptinit: typo: RPOMPT -> RPROMPT Arseny Maslennikov
2021-01-25 8:16 ` [PATCH 2/2] promptinit: Fix prompt cleanups Arseny Maslennikov
2021-01-25 8:23 ` Roman Perepelitsa
2021-01-25 12:50 ` Arseny Maslennikov
2021-02-18 13:03 ` Arseny Maslennikov [this message]
2021-02-20 0:50 ` (ping) " dana
2021-02-20 19:01 ` Bart Schaefer
2021-02-22 18:29 ` Bart Schaefer
2021-02-22 22:24 ` Arseny Maslennikov
2021-02-22 22:28 ` [PATCH v2] " Arseny Maslennikov
2021-02-22 23:50 ` 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=YC5lo5lOaFnc+3CN@cello \
--to=ar@cs.msu.ru \
--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).