Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why does zsh clear to end-of-screen after prompt?



On Mon, Sep 18, 2023 at 4:14 PM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> [ moved to -workers ]
> On 9 Sep, Bart Schaefer wrote:
> >
> > no_clr_eos () {
> >   emulate -L zsh
> >   if [[ $1 == cd ]]
> >   then
> >     REPLY=""
> >   elif [[ -n $2 ]]
> >   then
> >     REPLY=$(echotc "$@")
> >   else
> >     REPLY=$termcap[$1]
> >   fi
> > }
>
> The last 6 lines just restore what would be the default behaviour,
> right?

That is correct.  Although if I were writing it for the current dev
revision, I'd probably just use

  else REPLY=${ echotc "$@" }

since there'd be no subshell.

> Wouldn't it perhaps be helpful if there was an explicit way to fallback
> to the default such as by returning an error status.

Yes.  Or even just by "unset REPLY".

> The feature is
> mostly only used by the test suite to my knowledge.

It's used in X04zlehighlight.  I think there was a proposal to use it
in another test as well, but that never got done.




Messages sorted by: Reverse Date, Date, Thread, Author