bug-bash
[Top][All Lists]
Advanced

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

Re: PROMPT_COMMAND causing strange cursor behavior


From: Martin Sebor
Subject: Re: PROMPT_COMMAND causing strange cursor behavior
Date: Tue, 28 Apr 2015 08:39:23 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 04/28/2015 08:26 AM, Chet Ramey wrote:
On 4/27/15 1:26 PM, Martin Sebor wrote:

Bash Version: 4.3
Patch Level: 33
Release Status: release

Description:
When the PROMPT_COMMAND variable is set to a command such a printf
it causes the cursor to jump to disappear or jump to the wrong
positions when typing text that spans more than physical terminal
line. The problem exists in at least Bash 4.2 and 4.3 (but likely
earlier versions as well).

This isn't exactly a bug.  If readline doesn't know where the cursor is
when it starts to perform redisplay, it's not going to be able to put the
cursor in the right position.  Readline assumes that cursor starts in
column 0 and makes redisplay decisions based on that.

Yes, I subsequently found a report of a similar problem here:
http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00004.html

It seems that PROMPT_COMMAND shouldn't (isn't intended to) be
used for commands that produce output. If that's so, may I
suggest to mention it in the manual?

Otherwise, the trouble is that there are tools that use the
variable for just that purpose.

Thanks
Martin



reply via email to

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