-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable SaveAndRestoreHistory
by default
#4275
Enable SaveAndRestoreHistory
by default
#4275
Conversation
I'm in favor of this PR. I'd also go with 10000 lines instead of a 1000. :) |
I think this is a very good idea. This should make working with GAP for the user more convenient, since many people do not know how to activate history. |
I'm in favour of this |
I approve, I'd also approve raising the limit to 10,000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment here is essentially the same as for the colored prompts.
The history feature is most useful for relatively recent GAP input, so I doubt that keeping much more than 1000 lines in the history is of much use. But I have no strong opinion about what the best number is.
I increased the default value for |
53a160f
to
f88bda1
Compare
Is there a convenient way to suppress adding a particular line to the command history? Gap.app issues some commands from its GUI, most of which should probably not be added to the saved history. |
@RussWoodroofe hmm, I doubt it, but I am not sure (also, in general I know almost nothing about that interface Gap.app and xgap are using). I would suggest opening an issue requesting it; perhaps @frankluebeck has insights, but that's best discussed on such a new issue. |
@RussWoodroofe There is no generic hook for configuring the history. But it is implemented as simple GAP code. I guess you would need to overwrite the function |
@frankluebeck To complicating things, Gap.app loads gap without readline, so the less-tested code in cmdeditx.g is the relevant one. But I found a workaround that I think is reasonably clean: I replace LineEditKeyHandlers[1] with a short function that resets it back to CommandLineHistoryHandler. (So GAP skips all end-of-line processing for exactly one command line.) Thanks! |
Like this! |
SaveAndRestoreHistory
by default
I think a lot of people are missing out of this; and it should be safe for most. If this turns out to be wrong (as in: we get lots of complaints from people where it broke), we can still go back to the old default.
But perhaps I am missing other reasons that speak against it? @frankluebeck might have some suggestions.
Should IMHO be added to release notes, and even to the "top tier" news, because while being trivial and minor, I think many people will benefit from this (so many people to whom I taught this option reacted like "whaaaat??? I wish I had known about this years ago).
I am also tempted to raise the default number of lines from 1000 to 10000...
Text for release notes
Save and restore input history by default
GAP has supported saving and restoring the interactive input history for a long time, but this feature was off by default. With this release, it is now on by default. That means that if you run GAP, enter some commands, then exit it, and start it again, you can reach the commands entered in the previous session by the usual means of accessing the command history, e.g. by pressing the up-arrow key. Should you prefer the old behaviour, you can get it back by setting the
SaveAndRestoreHistory
user preference to false. For example, by entering these commands:SetUserPreference( "SaveAndRestoreHistory", false ); WriteGapIniFile();
In addition, the default limit on how many lines are preserved was increased from 1000 to 10000. This can be adjusted via the
HistoryMaxLines
user preference.