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

Merge fish history before showing history widget #3851

Closed
5 of 10 tasks
ismay opened this issue Jun 10, 2024 · 6 comments · Fixed by #3852
Closed
5 of 10 tasks

Merge fish history before showing history widget #3851

ismay opened this issue Jun 10, 2024 · 6 comments · Fixed by #3852

Comments

@ismay
Copy link
Contributor

ismay commented Jun 10, 2024

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.52.1

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

In this function: https://github.com/junegunn/fzf/blob/master/shell/key-bindings.fish#L59-L86 we're currently only showing the changes from the current session. If we call history merge beforehand commands from other sessions will be available as well.

Docs on history merge:

Immediately incorporates history changes from other sessions. Ordinarily fish ignores history changes from sessions started after the current one. This command applies those changes immediately.

from: https://fishshell.com/docs/current/cmds/history.html

We could do it similar to this widely used plugin: PatrickF1/fzf.fish, which also incorporates a check for private mode.

@junegunn
Copy link
Owner

Sounds good. Are you interested in opening a pull request?

@ismay
Copy link
Contributor Author

ismay commented Jun 10, 2024

Yeah sounds good. I should have time for it this week.

@ismay
Copy link
Contributor Author

ismay commented Jun 10, 2024

Actually it's not a lot of work, so I just created the PR now.

@adamsb6
Copy link

adamsb6 commented Oct 25, 2024

Would you entertain a PR to make this configurable? This is leading to lots of confusion for me, I typically have dozens of sessions open and I expect that when I arrow up in one of them, or search, I get the most recent for that session unless I've explicitly merged history.

It's especially pernicious when the command is super long and one arg is just slightly different, I'll end up breezing past it.

@junegunn
Copy link
Owner

Looks like you can set $fish_private_mode. See https://github.com/junegunn/fzf/pull/3852/files

@adamsb6
Copy link

adamsb6 commented Oct 26, 2024 via email

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 a pull request may close this issue.

3 participants