CONFIDENTIAL

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

Basically once you have gone back to a certain history even number, you cannot 
go forward again.

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.

cf. 
https://unix.stackexchange.com/questions/792793/bash-or-ksh-vi-mode-how-to-jump-to-end-of-history-most-recent-command

Regards,

Scott


Reply via email to