zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Budi <budikusasi@gmail.com>, Zsh Users <zsh-users@zsh.org>
Subject: Re: Zsh can't do "echo -n" preceding vared <variable>
Date: Thu, 17 Aug 2023 16:13:35 +0100 (BST)	[thread overview]
Message-ID: <785434724.2472140.1692285215448@mail.virginmedia.com> (raw)
In-Reply-To: <CAH0GyZD84HKsbE086ETnPC5FYOgjbNHMKKmBQcEJ1n6HOsQ2Kg@mail.gmail.com>

> On 17/08/2023 15:45 Budi <budikusasi@gmail.com> wrote:
> How come Zsh can't perform echo -n that precedes vared <variable>, as
> output is only the vared variable's content preceded by none ?

So it sounds like what you're trying to do is output something on the
same line that will be used for the vared, but without it being part
of the edit.  You can't do that by default as the line editor takes
over the whole screen line and will align back to the start.

What you can do is use "vared -p prompt" to output something at the
start of the line, which doesn't have that problem as vared knows
it's there.

Another thing you can do is set the NO_PROMPT_CR option, which
stops the line editor from performing the carriage return.  It
has bad effects if you are editing multiple lines, however ---
this is the difference from other shells that is the reason
for the usual zsh behaviour.  If you're sure the vared will only
be on a single line, you could set that option locally in a
function.  However, I hope vared -p is what you really need.

pws


  parent reply	other threads:[~2023-08-17 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 14:45 Budi
2023-08-17 14:53 ` Bart Schaefer
2023-08-17 15:13 ` Peter Stephenson [this message]
2023-08-17 15:20   ` Bart Schaefer
2023-08-17 23:00     ` Budi

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=785434724.2472140.1692285215448@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=budikusasi@gmail.com \
    --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).