Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: precmd hook invoked later than usual on very first prompt
- X-seq: zsh-users 26465
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Christian Parpart <christian@parpart.family>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: precmd hook invoked later than usual on very first prompt
- Date: Fri, 5 Feb 2021 20:32:53 +0100
- Archived-at: <https://zsh.org/users/26465>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-02/CAN%3D4vMrvV7MiCR07%2BA75fHFtnZR3nhKv8tigYhYXB8iX7o6K7w%40mail.gmail.com>
- In-reply-to: <CABfObkBxZniBoXTiHdsn74fU6ZKnTySox5HJCCjsbPB54h01iQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CABfObkBhX1jDB8aUGMvd52NGH8twOJdohX-0XfRsGgctjDxBGw@mail.gmail.com> <CAN=4vMopsqPWNTfgGCsG2Tmt6JkaUbkh9_ikcJ4FCTe=NZbA6w@mail.gmail.com> <CABfObkBN-gb14=yF=zzE+tCwqS2AdJk67==pasMWw0q=iuEhkQ@mail.gmail.com> <CAN=4vMqawHhbZh18KeOsWaH8R1mqgg0p962V1_qQ_PM0XPt+ug@mail.gmail.com> <CABfObkBxZniBoXTiHdsn74fU6ZKnTySox5HJCCjsbPB54h01iQ@mail.gmail.com>
On Fri, Feb 5, 2021 at 8:05 PM Christian Parpart
<christian@parpart.family> wrote:
>
> Hi,
>
> Yes indeed.
>
> You can find it here:
> https://github.com/christianparpart/contour/blob/master/contour-integration.zsh#L36
Thanks, this does help.
The first prompt you see is not actually a prompt. It just looks like
it. See https://github.com/romkatv/powerlevel10k#instant-prompt. It's
the same trick that some mobile operating systems and web browsers use
when they show a picture of the app/website while it's still loading.
To solve your problem you can embed '\e[?2027l' and '\e[>M' in the
prompt (you can leave '\e]7;'$(pwd)'\e\\' in precmd although I would
recommend getting rid of the fork to speed up your prompt [1]). Here's
one way to do it:
POWERLEVEL9K_DIR_PREFIX=$'%{\e[?2027l\e[>M%}'
Depending on your actual config this may or may not work. A proper
solution would be to open a feature request against powerlevle10k so
that your terminal gets first class support (it's not the only
terminal that uses marks of this sort).
Roman.
[1]: printf '\e]7;%s\e\\' $PWD >$TTY
Messages sorted by:
Reverse Date,
Date,
Thread,
Author