zsh-workers
 help / color / mirror / code / Atom feed
* precmd hook invoked later than usual on very first prompt
@ 2021-02-05 17:12 Christian Parpart
  2021-02-05 17:34 ` Roman Perepelitsa
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Parpart @ 2021-02-05 17:12 UTC (permalink / raw)
  To: zsh-workers

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

Hi,

I'm using zsh (fairly new to me) with oh-my-zsh and now also with p10k
customization, so that my prompt actually covers two lines, whereas the
first one is some meta info (cwd, etc), and the second will be the
(somewhat) decorated prompt.

Now, `add-zsh-hook precmd _my_precmd`,  as well as `add-zsh-hook preexec
_my_preexec` are being all invoked nicely.

Except for the very first prompt right after process spawn the preexec hook
is NOT being invoked on the upper line (first line of screen in a new
terminal, as with every other future prompt, but in the second line).

This makes it sadly nondeterministic and sadly kinda useless in my use case
at least. I (with no knowledge of zsh) would say thats a bug, hence I'm
writing here with the hope of some help or a trigger for a bugfix.

Best regards,
Christian Parpart.
p.s.: I'm using Ubuntu 20.10 (if that matters)

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

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

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

On Fri, Feb 5, 2021 at 6:13 PM Christian Parpart
<christian@parpart.family> wrote:
>
> Except for the very first prompt right after process spawn the preexec hook is NOT being invoked on the upper line

What does this mean?

preexec is not invoked on any line. It's invoked when you hit ENTER,
right before the command is executed.

Roman.


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

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

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

Was i writing preexec? Oh sorry. I meant precmd of course.

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

> On Fri, Feb 5, 2021 at 6:13 PM Christian Parpart
> <christian@parpart.family> wrote:
> >
> > Except for the very first prompt right after process spawn the preexec
> hook is NOT being invoked on the upper line
>
> What does this mean?
>
> preexec is not invoked on any line. It's invoked when you hit ENTER,
> right before the command is executed.
>
> Roman.
>

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

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

* Re: precmd hook invoked later than usual on very first prompt
  2021-02-05 17:58   ` Christian Parpart
@ 2021-02-05 18:02     ` Roman Perepelitsa
  0 siblings, 0 replies; 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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 17:12 precmd hook invoked later than usual on very first prompt Christian Parpart
2021-02-05 17:34 ` Roman Perepelitsa
2021-02-05 17:58   ` Christian Parpart
2021-02-05 18:02     ` Roman Perepelitsa

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