#681646 gnuplot: somtimes forgets previous command (can't see it in history either)

#681646#5
Date:
2012-07-15 02:53:35 UTC
From:
To:
Dear Maintainer,

now and then gnuplot seems to fail to store the command in its history,
so I can't recall it by ^P or up-arrow or any history command. In my
typical use, I recall previous command, make an edit and push <enter>.
It usually works fine, but sometimes gnuplots fails to remember the
command, so on next recall, I instead get a previous (what I did 2
command lines ago).

When it start, gnuplot insists on not remembering that same command line,
while it happily remembers other command lines in between, whether I
retype it manually, or recall it from history way back.

The following is a snapshot of gnuplot history:

  635  wx=0;w=12;t=t2;h=800;load "plot1"
  636  wx=0;w=12;t=t2;h=800;load "plot1"
  637  wx=0;w=12;t=t2;h=800;load "plot1"
  638  wx=0;w=8;t=t2;h=800;load "plot1"
  639  wx=0;w=8;t=6000;h=800;load "plot1"
  640  wx=0;w=8;t=6000;h=800;load "plot1"

Here I actually tried a callback form #639, to reuse #638, but that didn't
work, so I retyped #638, which is not seen in the history. Then I used
recall (up-arrow) from a earlier command (way up), which it remembered
as #639. Then I tried again by retyping #638, which also did not go into
the history, and #640 is a subsequent recall of #639.

When it happens, that command line cannot be entered into the history,
if I add two spaces to the bigging it gets remembered.

It happens often enough to be a bother, but not often enough to be
a nuisance :-) and I haven't worked out a more detailed case pattern.
Possibly it has something to do with that the line first is by a
recall where I deleted the first few characters (up to a semicolon).

#681646#10
Date:
2012-07-28 01:27:07 UTC
From:
To:
The following is an example of this bug by a very small session, after
having removed ~/.gnuplot_history before starting gnuplot. I have added
my own numbering of the commands.
--------------------
1: gnuplot> a=5;plot x
2: gnuplot> plot x
3: gnuplot> history
     1  history
4: gnuplot> plot x
5: gnuplot> plot x
6: gnuplot> plot 2*x
7: gnuplot> history
     1  history
     2  plot 2*x
     3  history
8: gnuplot> plot x
9: gnuplot> q
--------------------

Command #1 was typed as is.

Command #2 was obtained by up-arrow, 6*left-arrow, 4*rubout, enter.

Command #3 was typed as is; before typing, up-arrow recall showed me
command #1 and not #2. But neither are in the history (file).

Command #4 was typed as is; recall before typing showed #3 and #1, not #2.

Command #5 was typed as is; recall before typing shows #3 and #1, not #2
or #4.

Command #6 was typed as is; recall before typing shows #3 and #1, not
#2, #4 or #5.

Command #7 was typed as is; recall before typing shows #6, #3 and #1,
not #2, #4 or #5.

Command #8 was typed as is; recall before typing shows #7, #6, #3 and
#1, not #2, #4 or #5.

Command #9 was typed as is; recall before typing shows #7, #6, #3 and
#1, not #2, #4, #5 or #8.

#681646#15
Date:
2018-11-26 15:37:49 UTC
From:
To:
This is still a bug in current gnuplot 5.2.5, albeit with a bit different
behaviour.

Example:

...
Terminal type is now 'wxt'
gnuplot> a=5;plot x
gnuplot> plot x
gnuplot> history
    1   a=5;plot x     # No 'plot x'
gnuplot> plot 2*x
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
gnuplot> a=5;plot x
gnuplot> plot 2*x
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
    3   a=5;plot x
    4   plot 2*x
gnuplot> a=5;plot x
gnuplot> a=5;plot x
gnuplot> a=5;plot x
gnuplot> a=5;plot x
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
    3   a=5;plot x
    4   plot 2*x
    5   a=5;plot x
    6   a=5;plot x
    7   a=5;plot x
    8   a=5;plot x
gnuplot> plot x
gnuplot> a=5;plot x
gnuplot> a=5;plot x
gnuplot> a=5;plot x
gnuplot> plot x
gnuplot> plot x
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
    3   a=5;plot x
    4   plot 2*x
    5   a=5;plot x
    6   a=5;plot x
    7   a=5;plot x
    8   a=5;plot x
    9   a=5;plot x     # No 'plot x'
   10   a=5;plot x
   11   a=5;plot x     # No 'plot x'     # No 'plot x'
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
    3   a=5;plot x
    4   plot 2*x
    5   a=5;plot x
    6   a=5;plot x
    7   a=5;plot x
    8   a=5;plot x
    9   a=5;plot x
   10   a=5;plot x
   11   a=5;plot x    # No 'history'
gnuplot> history
    1   a=5;plot x
    2   plot 2*x
    3   a=5;plot x
    4   plot 2*x
    5   a=5;plot x
    6   a=5;plot x
    7   a=5;plot x
    8   a=5;plot x
    9   a=5;plot x
   10   a=5;plot x
   11   a=5;plot x    # No 'history'
gnuplot> q
user@debian:~/Downloads$ cat ~/.gnuplot
.gnuplot_history  .gnuplot-wxt
user@debian:~/Downloads$ cat ~/.gnuplot_history
_HiStOrY_V2_
a=5;plot\040x
plot\0402*x
a=5;plot\040x
plot\0402*x
a=5;plot\040x
a=5;plot\040x
a=5;plot\040x
a=5;plot\040x
a=5;plot\040x
a=5;plot\040x
a=5;plot\040x
q
user@debian:~/Downloads$