bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] Disable the "modify history with arrow keys" feature


From: frederik
Subject: Re: [Bug-readline] Disable the "modify history with arrow keys" feature
Date: Thu, 31 Jan 2019 09:49:38 -0800
User-agent: NeoMutt/20180716

I have "set revert-all-at-newline on" in ~/.inputrc. That's basically
the only thing there, aside from some keybindings and "set bell-style
none". I don't remember where I picked it up, it's been there for a
long time.

If I follow John's instructions with '4. Hit "down" to navigate to an
empty place' then I don't get the observed behavior, the line I edited
has been reverted.

However, if I 'hit "up" to navigate to another line in the history'
and then press "Enter", the edits I made to the 5566 line are not
reverted. This only holds if the line I press "Enter" at is *above*
the line I edited in the history, if I for example if I start with a
new prompt, go up two history entries, edit the first one, and then
navigate down and hit "enter" on the second one, the edit gets
reverted. If I edit the second one, and navigate up and hit "enter" on
the first one, the edit is still around and it shows up with an
asterisk in the output of "history":

   19991  echo a
   19992* echo 5        # was "echo b"
   19993  echo a
   19994  history | tail

This is with Bash 5.0.0(1).

Frederick

On Thu, Jan 31, 2019 at 09:54:29AM -0500, Chet Ramey wrote:
On 1/30/19 10:34 PM, 林自均 wrote:
Hi Chet,

Sorry. I realized that I didn't understand what "revert-all-at-newline" is
doing. I checked the manual, it says:

       revert-all-at-newline (Off)
              If set to On, readline will undo all changes to history lines
              before returning when accept-line is executed.  By default,
              history lines may be modified and retain individual undo lists
              across calls to readline.

According to the description, I set it to "On" and tried the following
steps in bash:

1. Type "echo 5566" and hit "enter"
2. Hit "up" to navigate to the history "echo 5566"
3. Change it to "echo 7788" and DON'T hit "enter"
4. Hit "down" to navigate to an empty place
5. Type "ls" and hit "enter"
6. Type "history | tail -n 3" and hit "enter"

After that, I expected that I can see the history "echo 5566" in the last
command since it should be reverted. However, I still see "echo 7788" in
the results:

    $ history | tail -n 3
      501* echo 7788
      502  ls
      503  history | tail -n 3

What did I miss? Thank you.

It's hard to say. When I try this, I get 'echo 5566' as expected. I suspect
something about how you set revert-all-at-newline, since the `echo 7788'
line has a `*' preceding it, indicating that it's still got an active undo
list.

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

_______________________________________________
Bug-readline mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-readline



reply via email to

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