zsh-workers
 help / color / mirror / 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

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git