Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Read a line from user without clearing screen below the prompt while allowing user to use arrow keys to make edits in middle of line
- X-seq: zsh-workers 51268
- From: Oliver Kiddle <opk@xxxxxxx>
- To: OG Code Poet <ogcodepoet@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Read a line from user without clearing screen below the prompt while allowing user to use arrow keys to make edits in middle of line
- Date: Sat, 31 Dec 2022 14:13:35 +0100
- Archived-at: <https://zsh.org/workers/51268>
- In-reply-to: <CAH+w=7adRQa1NJSw+73n6gVFO=x4YxjfwZ2E7brhoPVoomJyrw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CADmFDtUiRpYTYh21-aeE_UuSAHqG=c2vcRT0oSND+i9ehu4SOA@mail.gmail.com> <CAH+w=7ZDaLHEP6qa6eV0oSWkJAhj-TbY+sZZM+rUBrkgGoBF-w@mail.gmail.com> <CADmFDtVoEiSsLi4DWC22+yW2LzbFUXpAnWL1_0MrmcPtgh6PYg@mail.gmail.com> <CAH+w=7adRQa1NJSw+73n6gVFO=x4YxjfwZ2E7brhoPVoomJyrw@mail.gmail.com>
Bart Schaefer wrote:
> If this is unsatisfactory, you could try using zcurses to manage the
> display, which I think would allow you to always redraw whatever vared
> erased.
The first idea that came into my mind was to try setopt singlelinezle
Unfortunately, that doesn't especially help. I think the clearing from
the cursor to the end of the window serves a purpose in general. It may
be that this could be relaxed for singlelinezle without breaking
anything. A script has control of anything like completion that
potentially results in further printing of characters.
Another option would be to provide zle with control of the text you want
to appear after the input by putting it in POSTDISPLAY:
other-stuff() { POSTDISPLAY=$'\none\ntwo\nthree' }
zle -N other-stuff
vared -i other-stuff -c out
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author