[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read -e deletes extra characters

From: isabella parakiss
Subject: Re: read -e deletes extra characters
Date: Tue, 24 Mar 2015 17:19:37 +0100

On 3/24/15, Chet Ramey <address@hidden> wrote:
> There are a number of unjustified expectations here.  The biggest is that
> readline can know about characters printed to the screen by another
> program.  Readline expects to be able to use the entire line and that it
> begins with the cursor in column 0.

This cannot be right.

The other program's prompt is never deleted when i use read -p ' ', I
can only erase until the point where readline printed that space.
This means that readline _does_ know where to stop, right?

This is what I consider the "correct" behaviour.  Is there any way to
achieve this without printing additional characters to the screen?

>                                      The second is that you're going to
> be able to drive an arbitrary program via a pipe -- the key to rlwrap's
> working is that it allocates and uses a pty.

I don't want to write a pty in bash, I just want readline to stop where
it printed the 'empty prompt' when I use read -e -p '' (which would be
good enough for most cli programs).

To summarize:

Please explain why using read -e -p ' ' the other program's prompt won't
be deleted, but it will if i use read -e -p ''

xoxo iza

reply via email to

[Prev in Thread] Current Thread [Next in Thread]