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