Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: psychiatric help
- X-seq: zsh-users 30500
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: psychiatric help
- Date: Sun, 5 Apr 2026 22:03:44 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=76cTh0Kp2jCvoSgN4VkMlJjYfCrv036v+f/QtmRCAuc=; fh=yk3c4scJWo86Za4IR1HBNZw2a+GkUkfVQ7Fs3jnanfg=; b=KerjFe7+sUX6KWFzHSWemOLR5cQiOaYaP0GHgWEDSOl0YAFxF0iuYUYiWsJZaxF7YI 7XUymOECyrs/6gtO55OOeGRDRMBVBptOWFR5kfEqGdDM0k3w50jNxMkNbEdFHxQbTrmt JjFuDKVDna+eji0/9FYhJriFeksteckraJDE2QdqlYl+X5UkEV/GSL11O4ezeHn4R6+R 0nMLbpt/CSazxVfvZ07cI9mckorTqe06TfQurX98E5dV318qYd5tb+Fte0/N7cq2MAQD 2ZOMSE+MjgNjN6HSJT3iIg7j+F2zz+grliFuzYxU0H+q2Xl3eivi9LQPiI46og45DtQE xy+w==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1775451836; cv=none; d=google.com; s=arc-20240605; b=hRUVIb+uv0zKAjlrxK6AEBLVyMdlMZmy1YnSzu+LgPSFky1j+daKLhTRCnFkGzBcPM 4/cvjJdW1Q5WGipPeyc2Eia8e7xBcMK5+U+7aclq3s4e4kt+UVM90XXdPQGYO3lnhPAA MSfZl54wItBrv36IJiP10PrvBn9SkIKa9FqJLAJnjCkOt0w+iI7Fr0Ztt2QESG0/NvKy YJFWEQ3Dl4yBUo+tDkHe8OadOeXYEkeyhznYHYnjl4ycL33/iEghtrDvkW4mcGKe+Ecw RAW5AtiT27IjLc/v0uAeMT1YEiw2pICCrH16NAxBC4CUfdQBcFkTqB88o313SM48wtNW epGg==
- Archived-at: <https://zsh.org/users/30500>
- In-reply-to: <d0c21ec7-832b-4ac5-a855-4b914827c61d@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <0610849d-f81c-4539-b13d-c4be9cbd1276@eastlink.ca> <CAA=-s3yUhzu7WbAB0F09abwmzPYowJ1s6o+YiV+cuQBf-GvFXw@mail.gmail.com> <448d6d35-c261-4e7e-bc67-c2a58d082b87@eastlink.ca> <CAA=-s3wKQb+1Sq2mV+h2Gk8rOQYKt8x_JNg9NhmdwAgJesxBkQ@mail.gmail.com> <755f4aa9-e27a-4b4d-8f23-add76a13ee83@eastlink.ca> <CAH+w=7Ydks9vqHA8x_zcHq454q8_C49Tq0xqPWuv9ejKYxCoOA@mail.gmail.com> <fcd552e0-d0eb-4443-bf6a-8ba11663638f@eastlink.ca> <CAH+w=7aksiqTuN4A_203YDWd9RfBwq2X83Oo9z0=45Md6aeWSg@mail.gmail.com> <e2d7c5e8-b994-4f38-8396-c21d493a617b@eastlink.ca> <CAH+w=7abnQZxhPc8AfsOxenKFL5tWce9A52GXv7m9rHh5eXHGw@mail.gmail.com> <d0c21ec7-832b-4ac5-a855-4b914827c61d@eastlink.ca>
On Sun, Apr 5, 2026 at 9:01 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> That's where I want to be but I have no idea how to get into the
> widget. Never been near a widget yet.
If you've got "compinit" in your .zshrc, you've been near hundreds of
widgets. "Widget" is just the zsh name for a function that is
executed by ZLE.
> On 2026-04-05 19:24, Bart Schaefer wrote:
> >
> > The place you can access $BUFFER is in the zle-line-finish widget.
zle-line-finish is a "special" widget that ZLE runs automatically just
after accept-line (the widget normally bound to Enter/Return). By
default it's not defined at all, so you have to create it.
> > zle -N zle-line-finish _tt
Like that.
> > then put that nauseating thing back into BUFFER, as long as you're
> > still in the zle-line-finish widget.
"In" the widget just means still running the commands of the shell function.
> > Try that and observe the result.
> Ok, I can copy that and give it a go. Probably still want _execute cuz
> it does some other stuff too
The important bit is that you should NOT call "eval" of anything, and
that the assignment to BUFFER contains the command line you want to
run. So if you want to keep using _execute, you would likely replace
the "eval" by the assignment of BUFFER=.
> How do we access the users archives?
https://www.zsh.org/mla/ although I believe searching is still broken
so you need to know an article number or pore over the indexes.
> Any chance of doing this kind of thing in preexec()?
> So it's always available?
zle-line-finish runs before preexec and is also always available.
However, you can't do in preexec what your ,H thing does, for two
reasons: First, preexec can't change what is going to be executed, it
can only examine it. Second, preexec is called after aliasing,
globbing, etc., happens, so you can't get at the partly-rewritten
command line that you want.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author