-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
X.P: Add escape hatch for preventing X.P IO #864
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
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.
Wouldn't the easiest thing be to just not write the history file if the history size is 0?
@slotThe
I'm happy to implement that if the alternative isn't preferable |
@slotThe I have changed the pull request to pattern match |
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.
This looks fine to me, and is definitely the least intrusive change. Neither readHistory
, nor writeHistory
is exported, so this does not result in a breaking change for anyone.
@slotThe the only downside to a non-breaking change is that |
Both |
@dcousens ping for ^ |
@slotThe to clarify, you think I should introduce a breaking change [that you have suggested] in this pull request? |
@dcousens sorry for only getting back to you now: I'm saying that I feel ambivalent about introducing a breaking change for |
OK, I'll have a shot at that, I'd prefer that personally |
@dcousens friendly ping :) |
Rebased and added a breaking commit, which ensures that |
This contains a breaking change for readHistory, writeHistory, historyCompletion, and historyCompletionP to take an XPConfig, so they are aware of this choice. While the latter two are exported, it seems unlikely to affect many users.
Thank you! |
Rationale
When using
XMonad.Prompt
for multiple (8+) different use cases in my configuration, I never once needed a command history.The default of reading and writing a file for the command history opaque to the user is strange to me, and each prompt is sharing and replacing the same
prompt-history
file... but I digress.My feature request is to stop that behavior, where
historySize = 0
didn't cut the mustard sinceprompt-history
is still reading and writing on every prompt.ProposalThis pull request addshistoryRead
andhistoryWrite
configuration options toXPConfig
, allowing users to write something like:This could open up functionality for using other state for a command history, but maybe that isn't desired.My main priority with this pull request is to prevent the reading and writing of the
prompt-history
file, and as such I am marking this as a draft until discussion resolves the best path forward.Proposal (current)
historySize = 0
should branch the IO behavior, and prevent any related IO (reading or writing).Checklist
I've read CONTRIBUTING.md
I've considered how to best test these changes (property, unit,
manually, ...) and concluded: unknown, I am using these changes locally
I updated the
CHANGES.md
file