Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to fix run-help-* functions?
- X-seq: zsh-workers 51571
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Michele Venturi <dardo82@xxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: How to fix run-help-* functions?
- Date: Mon, 13 Mar 2023 13:31:34 -0700
- Archived-at: <https://zsh.org/workers/51571>
- In-reply-to: <CAHYJk3R4T82A_SYQfqhmd+h8EN6QwCmPmTjMUSZZ4x-LkEzcMw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CA+Ds4NvZ1uQhgfZChLWAT2_QjTjMzZfujFXDLAfmAR8=z3gv6g@mail.gmail.com> <CAH+w=7a=-==MoeLJLUVLvkedvO=qi-jTU3G2uLasivQhZZU78Q@mail.gmail.com> <1454747193.3405418.1678210315384@mail.virginmedia.com> <CAH+w=7YVtW=YmMiB60mssvYskitkxruFQVE3ai3g5KvPesN7ZQ@mail.gmail.com> <CA+Ds4NtzgeBtHGo9fdXFLc0xFzQM8WfFxoKr6R7OEkT5Y=qV7g@mail.gmail.com> <CAH+w=7Zf8S_eCgvYjTV3sp5h8ApXwy9SduMKViBe+hha0_OZHg@mail.gmail.com> <CAHYJk3R4T82A_SYQfqhmd+h8EN6QwCmPmTjMUSZZ4x-LkEzcMw@mail.gmail.com>
On Mon, Mar 13, 2023 at 11:19 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 3/13/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > Question for the audience is whether we want to consider this a bug
> > and make it possible to use run-help as a standalone function.
>
> It could/should at least output some diagnostic, because it is very
> easy for an end-user (or very confused developer) to do this:
> % git<invoke run-help>
> % git<now press page up and enter which changes this line to:>
> % run-help git
> git is /usr/bin/git
> run-help:shift:106: shift count must be <= $#
A reasonable point.
> Looking at the code for processcmd it seems to literally only insert
> the string "run-help git" on the command line, so what exactly is this
> preliminary setup? I can't find it.
It does a push-line so that the run-help function can retrieve it with
getln. See workers/49218
If there's no line pushed, the run-help function is going to push a
blank one (with print -z) immediately after getln fails, so there's
several things that need to (not) happen if the widget is not used.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author