On 6/8/20 12:46 AM, Leo Alekseyev wrote:
> With GNU readline 7.0 / bash 4.4.20(1) it appears to be impossible to
> insert nth argument of a previous command in vi mode.
> 
> According to the manual, setting a numeric argument (e.g. Alt-1) and
> repeatedly invoking Alt-. should keep inserting nth argument from
> preceding commands. For example, issuing
> 
> echo arg1 arg2
> echo argA argB
> 
> and pressing Alt-1 Alt-. Alt-. inserts arg1 (first inserting argA,
> then replacing with arg1).
> 
> However, the same sequence of operations fails in vi mode even when
> the keys are bound appropriately. In particular, pressing Alt-1 Alt-.
> Alt-. inserts argA arg2.
> 
> Subsequent invocation of Alt-. replace arg2 with the 2nd argument of
> the preceding command, i.e. readline is now behaving as if the numeric
> argument were 2.
> 
> This certainly seems like buggy/out-of-spec behavior, is there a known
> workaround?

The common backend for yanking the last argument implements the vi-mode
standard behavior for the `_' command, which is what you observe. I'll see
if I can disentangle it.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Reply via email to