Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why does zsh clear to end-of-screen after prompt?
- X-seq: zsh-users 29200
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: John Hawkinson <jhawk@xxxxxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Why does zsh clear to end-of-screen after prompt?
- Date: Fri, 25 Aug 2023 18:39:08 -0700
- Archived-at: <https://zsh.org/users/29200>
- In-reply-to: <ZOlOaISfwY6RFrfH@louder-room.local>
- List-id: <zsh-users.zsh.org>
- References: <ZOkGi5f6hPuk_1-b@louder-room.local> <CAH+w=7ZQaJgvk=wLX5mVEC4XR3AP1kxZU+t6O88PZFAZ6p6w9Q@mail.gmail.com> <ZOlOaISfwY6RFrfH@louder-room.local>
On Fri, Aug 25, 2023 at 5:59 PM John Hawkinson <jhawk@xxxxxxxxxxxx> wrote:
>
> Ugh. I suppose it would be too much to ask that it not do this in the (for me) 90+% case where neither completion nor multi-line editing have been used?
Maybe you're actually an audience for https://github.com/psprint/n-commodore ...
> In case it wasn't apparent, the use case is I had a small ad hoc script that produced ~20 lines of key/value output and sometimes the values change and I'd like to keep them in the same position on the screen and just overwrite themselves when they change if I rerun the script with up-arrow/RET.
If it's OK for the output to be at the top of the screen and the
prompt toward the bottom:
preexec() { print -n $'\e[H' }
You can make this conditional, e.g., only do it if repeating the same
command again, or make a widget that sets the desired starting
position of the output so this only happens if you use that widget
instead of accept-line, etc.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author