zsh-workers
 help / color / mirror / code / Atom feed
* Re: Why does zsh clear to end-of-screen after prompt?
       [not found]     ` <CAH+w=7ba2eATAi3enewDJfwr5NVo0PPb0EtD8b_DKzeFFxXa4g@mail.gmail.com>
@ 2023-09-18 23:14       ` Oliver Kiddle
  2023-09-18 23:32         ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2023-09-18 23:14 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[ moved to -workers ]
On 9 Sep, Bart Schaefer wrote:
> How about this, then?  I'd completely forgotten about "zle -T" ...
>
> 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?

Wouldn't it perhaps be helpful if there was an explicit way to fallback
to the default such as by returning an error status. The feature is
mostly only used by the test suite to my knowledge. I think I once used
the feature to send the parameters to a separate terminal for debug
purposes and could have done with it also keeping the defaults for that
use-case too.

Oliver


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why does zsh clear to end-of-screen after prompt?
  2023-09-18 23:14       ` Why does zsh clear to end-of-screen after prompt? Oliver Kiddle
@ 2023-09-18 23:32         ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2023-09-18 23:32 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-workers

On Mon, Sep 18, 2023 at 4:14 PM Oliver Kiddle <opk@zsh.org> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-18 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ZOkGi5f6hPuk_1-b@louder-room.local>
     [not found] ` <CAH+w=7ZQaJgvk=wLX5mVEC4XR3AP1kxZU+t6O88PZFAZ6p6w9Q@mail.gmail.com>
     [not found]   ` <ZOlOaISfwY6RFrfH@louder-room.local>
     [not found]     ` <CAH+w=7ba2eATAi3enewDJfwr5NVo0PPb0EtD8b_DKzeFFxXa4g@mail.gmail.com>
2023-09-18 23:14       ` Why does zsh clear to end-of-screen after prompt? Oliver Kiddle
2023-09-18 23:32         ` Bart Schaefer

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).