zsh-users
 help / color / mirror / code / Atom feed
* Re: precmd hook invoked later than usual on very first prompt
       [not found]   ` <CABfObkBN-gb14=yF=zzE+tCwqS2AdJk67==pasMWw0q=iuEhkQ@mail.gmail.com>
@ 2021-02-05 18:02     ` Roman Perepelitsa
  2021-02-05 19:05       ` Christian Parpart
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Perepelitsa @ 2021-02-05 18:02 UTC (permalink / raw)
  To: Christian Parpart; +Cc: Zsh Users

On Fri, Feb 5, 2021 at 6:59 PM Christian Parpart
<christian@parpart.family> wrote:
>
> Was i writing preexec? Oh sorry. I meant precmd of course.

Oh, I think I know what this is about. This is almost certainly not a
bug in zsh.

[bcc:zsh-workers]
[cc:zsh-users]

Do you print something to the terminal in precmd? If you can post the
code of the precmd hook, it would help.

Roman.


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

* Re: precmd hook invoked later than usual on very first prompt
  2021-02-05 18:02     ` precmd hook invoked later than usual on very first prompt Roman Perepelitsa
@ 2021-02-05 19:05       ` Christian Parpart
  2021-02-05 19:32         ` Roman Perepelitsa
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Parpart @ 2021-02-05 19:05 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

Hi,

Yes indeed.

You can find it here:
https://github.com/christianparpart/contour/blob/master/contour-integration.zsh#L36

However, these VT sequences definitely won't work in other terminals. But
the general case should be clear. Only VT sequences are written to the
terminal that do not generate any text.

Best regards,
Christian Parpart.

On Fri, Feb 5, 2021, 19:02 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

> On Fri, Feb 5, 2021 at 6:59 PM Christian Parpart
> <christian@parpart.family> wrote:
> >
> > Was i writing preexec? Oh sorry. I meant precmd of course.
>
> Oh, I think I know what this is about. This is almost certainly not a
> bug in zsh.
>
> [bcc:zsh-workers]
> [cc:zsh-users]
>
> Do you print something to the terminal in precmd? If you can post the
> code of the precmd hook, it would help.
>
> Roman.
>

[-- Attachment #2: Type: text/html, Size: 1500 bytes --]

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

* Re: precmd hook invoked later than usual on very first prompt
  2021-02-05 19:05       ` Christian Parpart
@ 2021-02-05 19:32         ` Roman Perepelitsa
  2021-02-05 21:34           ` Christian Parpart
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Perepelitsa @ 2021-02-05 19:32 UTC (permalink / raw)
  To: Christian Parpart; +Cc: Zsh Users

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


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

* Re: precmd hook invoked later than usual on very first prompt
  2021-02-05 19:32         ` Roman Perepelitsa
@ 2021-02-05 21:34           ` Christian Parpart
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Parpart @ 2021-02-05 21:34 UTC (permalink / raw)
  To: Roman Perepelitsa; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

Thanks man,
I will try it out and also contact p10k devs about a supportive middle
ground.

Have a great weekend,
Christian Parpart.

On Fri, Feb 5, 2021, 20:33 Roman Perepelitsa <roman.perepelitsa@gmail.com>
wrote:

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

[-- Attachment #2: Type: text/html, Size: 2183 bytes --]

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

end of thread, other threads:[~2021-02-05 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABfObkBhX1jDB8aUGMvd52NGH8twOJdohX-0XfRsGgctjDxBGw@mail.gmail.com>
     [not found] ` <CAN=4vMopsqPWNTfgGCsG2Tmt6JkaUbkh9_ikcJ4FCTe=NZbA6w@mail.gmail.com>
     [not found]   ` <CABfObkBN-gb14=yF=zzE+tCwqS2AdJk67==pasMWw0q=iuEhkQ@mail.gmail.com>
2021-02-05 18:02     ` precmd hook invoked later than usual on very first prompt Roman Perepelitsa
2021-02-05 19:05       ` Christian Parpart
2021-02-05 19:32         ` Roman Perepelitsa
2021-02-05 21:34           ` Christian Parpart

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