[Top][All Lists]

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

Re: ^O gets stuck if there's a bunch of history

From: gregrwm
Subject: Re: ^O gets stuck if there's a bunch of history
Date: Tue, 20 Sep 2011 05:52:23 -0500

> OK, thanks for the clarification.  I see the problem.  It's an incorrect
> calculation of the `next history line' in operate_and_get_next() that
> mishandles this particular case.
> By default, bash limits the size of the history to 500 commands, which
> means you get the commands you executed and around the last 490 or so
> `echo's you wrote to the history file in the history list.  The history
> list is full up.
> operate_and_get_next assumes that the line will be added to the history,
> either at the end (shuffling everything down one) if you've reached the
> $HISTSIZE limit, or as the next entry numerically.  In this case, an
> incomplete command with command-oriented-history set to 1, the line is
> not added as a separate history entry, so the history never gets shuffled
> down and the current entry stays at the same command.
> The code has been this way for over 20 years, so this is a
> very-infrequently-encountered problem. I will have to look at the startup
> hook the command uses to see if I can fix it up there.

fwiw you might also note the behaviour of ^O operating on a multiline
command is inconsistent between whether the multiline command was
entered in the current session or was found in the history file.  if
from current session the entire multiline command re-enters the
command buffer, if from the history file it reenters the command
buffer one line at a time.  i don't consider this a problem, but it
may or may not be related to what you've found.
thanks again,

reply via email to

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