|
From: Ethan A M. <sf...@us...> - 2013-12-17 17:44:40
|
On Saturday, 14 December, 2013 09:10:12 pl...@pi... wrote:
> On 12/14/13 08:58, Ethan Merritt wrote:
> > On Tuesday, 19 November 2013 05:29:58 PM pl...@pi... wrote:
> >> On 11/19/13 16:24, Petr Mikulik wrote:
> >>> There is no option to switch "history" between "compact" and "full"
> >>> recording. That could be probably added...
> >>>
> >>> ---
> >>> Petr Mikulik
> >>
> >> that would be nice and presumably pretty trivial to just stop it doing
> >> the compacting.
> >>
> >>
> >> If anyone can point me at the relevant code I will have a poke.
> >>
> >> thx, Peter.
> >
> > I think you can replace the entire #ifdef clause at command.c(rlgets) lines 2718-2751
> > with the single line
> > add_history(line);
> >
> > This works for all three cases of the #ifdef.
> >
> > Ethan
> >
>
> Thanks Ethan,
>
> I'll try to find time to check that out. It's about time a did fresh
> build anyway.
I went ahead and added this to CVS since it's a trivial amount of code.
The new command to trigger it is "set history full".
Full syntax for new command is
set history {size <N>} {quiet|numbers} {full|trim} {default}
Examples
set history size N # replaces "set historysize N"
set history size -1 # replaces "unset historysize"
set history quiet # subsequent `history` commands will not show numbers
set history numbers # subsequent `history` commands will show numbers
set history trim # [old default] remove duplicate history entries
set history full # do not alter list by removing old duplicate entries
set history default # equivalent to "set history size 500, numbers, trim"
Tested under linux with libreadline, builtin readline, and BSD editline.
Not tested with the OSX mangled version of editline that masquerades as readline.
I dind't try for an option to suppress only duplication of the previous command.
It probably wouldn't be that much additional code if someone wants to pursue it.
Ethan
|