Skip to content
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

[Search history] don't merge history when in private mode #245

Merged
merged 3 commits into from
Jul 1, 2022

Conversation

kidonng
Copy link
Contributor

@kidonng kidonng commented Jun 22, 2022

Calling history merge in private mode (fish --private) clears the session history. So if you execute the search history function while in private mode, there is no history to search.

@PatrickF1
Copy link
Owner

Calling history merge in private mode (fish --private) clears the session history

Are you saying it clears the session history of the current session but leaves the other sessions' history intact, or it clears every session's history?

@kidonng
Copy link
Contributor Author

kidonng commented Jun 22, 2022

Are you saying it clears the session history of the current session but leaves the other sessions' history intact, or it clears every session's history?

Just the current session (if it ever does the latter, I would be crying).

@PatrickF1
Copy link
Owner

This seems like a bug that should be fixed in fish. Why would they cause it to clear history?

@kidonng
Copy link
Contributor Author

kidonng commented Jul 1, 2022

But we can fix it now, instead of waiting for identifying if this is really an issue and fish release a new version with fix.

@PatrickF1
Copy link
Owner

Sure! In the meantime, I've filed a bug report fish-shell/fish-shell#9050

@PatrickF1 PatrickF1 changed the title [Search history] skip merging history in private mode [Search history] don't merge history when in private mode Jul 1, 2022
@PatrickF1 PatrickF1 merged commit bb70287 into PatrickF1:main Jul 1, 2022
@PatrickF1
Copy link
Owner

Oh wow bug already got fixed in fish-shell master. Looks like the fix is to make it error out so regardless, it was good that we merged this.

@@ -1,6 +1,9 @@
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
# history merge incorporates history changes from other fish sessions
builtin history merge
# skip merging in private mode as it clears current session history
if test -n "$fish_provate_mode"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops just realized there's a typo here. I'll fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time to get a spell checker for vim I guess 😅

PatrickF1 added a commit that referenced this pull request Jul 1, 2022
Fix wrong test operator and typo in variable name. Follow up to #245.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants