From: Bart Schaefer <schaefer@brasslantern.com>
To: John Hawkinson <jhawk@alum.mit.edu>
Cc: zsh-users@zsh.org
Subject: Re: Why does zsh clear to end-of-screen after prompt?
Date: Fri, 25 Aug 2023 18:39:08 -0700 [thread overview]
Message-ID: <CAH+w=7bM1+9S_+cgJeUGaqQ9-WUf3s985PDyPxnSW8gMokgEqA@mail.gmail.com> (raw)
In-Reply-To: <ZOlOaISfwY6RFrfH@louder-room.local>
On Fri, Aug 25, 2023 at 5:59 PM John Hawkinson <jhawk@alum.mit.edu> 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.
next prev parent reply other threads:[~2023-08-26 1:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 19:52 John Hawkinson
2023-08-26 0:18 ` Bart Schaefer
2023-08-26 0:59 ` John Hawkinson
2023-08-26 1:39 ` Bart Schaefer [this message]
2023-08-27 8:34 ` Roman Perepelitsa
2023-08-27 15:36 ` Grant Taylor
2023-08-27 16:02 ` Roman Perepelitsa
2023-08-27 18:55 ` Grant Taylor
2023-09-09 23:23 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7bM1+9S_+cgJeUGaqQ9-WUf3s985PDyPxnSW8gMokgEqA@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=jhawk@alum.mit.edu \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).