bug-bash
[Top][All Lists]
Advanced

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

Re: Problem with bind -x


From: Chet Ramey
Subject: Re: Problem with bind -x
Date: Fri, 24 Apr 2015 11:41:22 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 4/21/15 3:42 PM, isabella parakiss wrote:
> I noticed a problem with bind -x: readline re-prints the line if the
> function is called when the cursor is not in the first line.

This is a difficult problem.  The readline redisplay engine does not know
where the cursor is when the command completes -- your example function
doesn't produce any output, but that's not guaranteed.  The `execute-
command' code bound to bind -x erases the current line and places the
cursor at column zero, to avoid mixing any output from the command with
the line buffer's contents, so it knows it has to redraw something.  It
makes the conservative choice and redraws the current line completely.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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