zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: zsh-workers@zsh.org
Subject: Re: Why does zsh clear to end-of-screen after prompt?
Date: Mon, 18 Sep 2023 16:32:52 -0700	[thread overview]
Message-ID: <CAH+w=7YrKoZv-eWJ4xG0NRfvthkR2TWwr2xURo8ojipKO3AqJw@mail.gmail.com> (raw)
In-Reply-To: <23391-1695078881.417127@hXqK.BiYQ.sk8c>

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.


      reply	other threads:[~2023-09-18 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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       ` Oliver Kiddle
2023-09-18 23:32         ` Bart Schaefer [this message]

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=7YrKoZv-eWJ4xG0NRfvthkR2TWwr2xURo8ojipKO3AqJw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=opk@zsh.org \
    --cc=zsh-workers@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).