Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: query terminal properties on ZLE startup
- X-seq: zsh-workers 53385
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: PATCH: query terminal properties on ZLE startup
- Date: Wed, 26 Feb 2025 09:53:48 +0100
- Archived-at: <https://zsh.org/workers/53385>
- In-reply-to: <5355-1740527169.384113@fufd.0HLy.otw9>
- List-id: <zsh-workers.zsh.org>
- References: <42572-1740099942.836692@_3BM.v5Iz.JqiS> <F07C8421-2663-440A-82AD-0748D39511B1@kba.biglobe.ne.jp> <CAH+w=7a9hye-2BxQUjkHw-=zFo5T7vXjVwQRnKnKEoZ3W0-_ug@mail.gmail.com> <40483-1740433325.086036@2QZo.3hhS.-9FG> <CAH+w=7Zf3vL6BYg0t61uskLmDD_gOwE7XhuwxB9SSwv+z0qOKw@mail.gmail.com> <69272-1740474756.308875@TCCj.PrGv.2vsI> <CAH+w=7ZJNRy2zV7t4wRhzcnW1jn2LgRKbMByCOrtbr9VVM2emw@mail.gmail.com> <5355-1740527169.384113@fufd.0HLy.otw9>
On Wed, Feb 26, 2025 at 12:46 AM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Bart Schaefer wrote:
> > I'd like to see Roman's startup time stats run again with this in
> > place. If querying the terminal significantly delays the printing of
> > the first prompt, I'd think this should at least be something that can
> > be setopt'd off and explicitly invoked later.
>
> I'm not sure what Roman's startup time stats did precisely but it is
> tiny in comparison to the sorts of times you get for starting completion
> or any of the more substantial plugins.
I believe Bard is referring to https://github.com/romkatv/zsh-bench,
which, among other things, measures:
- First prompt lag (ms): The time from the start of the shell to
when the prompt appears on the screen.
However, zsh-bench isn't necessary for this particular case. A simple
benchmark like the following would suffice:
time ( repeat 1000 zsh -fc 'zmodload zsh/zle' )
> Over the serial line 0.2s was about the minimum to be
> guaranteed of completion.
In my own zsh startup files, I query the terminal and use a much
higher timeout of 5s for this. When the timeout triggers, the
experience is terrible: the shell ends up misconfigured (naturally,
as the initialization depends on the reply), and zle receives junk
input unpredictably when the terminal finally responds. I've run
into this issue a couple of times when connecting over SSH to
machines with extreme packet loss.
I'd prefer if there were no timeout at all, requiring manual
interruption with Ctrl-C instead, like other initialization steps and
hooks. Would that be feasible in your implementation?
Roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author