On 3/25/25 11:58 PM, Scott ROCHFORD wrote:
CONFIDENTIAL

Oh?



bash-4.4.20-5.el8.x86_64 & readline-7.0-10.el8.x86_64 on RHEL 8.10

$ echo $BASH_VERSION

4.4.20(1)-release

$ set -o vi

$ : one

$ : two

$ : three

$ history

     1  echo $BASH_VERSION

     2  set -o vi

     3  : one

     4  : two

     5  : three

     6  history

'<esc>4G' displays :

$ :two

'3G' displays

$ :one

'6G' - or any number greater than 3 - incorrectly displays first entry in history

$ echo $BASH_VERSION

This was fixed in bash-5.2 to ring the bell and not change the current
line, which is consistent with the POSIX standard for sh vi-mode editing.

Ideally 'G' on its own should jump to 'end-of-history' without having to remap bindings (would lose <n>G functionality), but as it stands all roads lead to beginning-of-history.

That's how POSIX says it's supposed to work.

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

Reply via email to