At startup, we use a new compiled function (historyLength(), which returns the value of readline's history_length variable) to determine how many lines of history we've saved from previous sessions. We add this value to the line numbers of any code from stdio when calling code so we get the correct lines back when calling getHistory.
Before
i1 : f = x -> x^2;
i2 : code f
o2 = stdio:1:6-1:11: --source code:
-- This is the beginning of your Macaulay2 log stored at /home/profzoom/.Macaulay2/history.m2
After
i1 : f = x -> x^2;
i2 : code f
o2 = stdio:1:4-1:12: --source code:
f = x -> x^2;
At startup, we use a new compiled function (
historyLength()
, which returns the value of readline'shistory_length
variable) to determine how many lines of history we've saved from previous sessions. We add this value to the line numbers of any code fromstdio
when callingcode
so we get the correct lines back when callinggetHistory
.Before
After
Closes: #3415