wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.33k stars 136 forks source link

Right interactive panel with changes not shown when glo inside tmux #227

Closed carmilso closed 1 year ago

carmilso commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

Hi all,

I'm facing a minor issue that I would like to fix. The thing is that when I use forgit inside tmux, then I don't see the interactive panel at right that shows changes when you select the commits from the left when you do a glo.

So if I am not in tmux then it shows the two panels: at left you can see the history of commits and at right you can see the changes. But for some reason this is not the behaviour when you do it inside tmux. So inside tmux I need to on every commit to see the changes.

This is my forgit configuration:

export FORGIT_FZF_DEFAULT_OPTS="$FORGIT_FZF_DEFAULT_OPTS
--reverse
--exact
--border
--cycle
--height '90%'
"

Any idea about this?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

carlfriedrich commented 1 year ago

@carmilso This should usually work (and works in my case). Does running a plain fzf show a preview window for you in both scenarios?

fzf --preview "cat {}"

Do you have fzf-tmux installed?

carmilso commented 1 year ago

@carlfriedrich this is what I tried:

fzf --preview "cat {}"

That command gives me the following error output: image

On the other hand, fzf-tmux is installed since I can run it.

So this is the output outside tmux:

image

And this is the output when I'm inside tmux (where you need to enter into each file changed to see changes):

image

carlfriedrich commented 1 year ago

Strange that your plain fzf command does not work. How does this behave?

find | fzf --preview "cat {}"
carmilso commented 1 year ago

Strange that your plain fzf command does not work. How does this behave?

find | fzf --preview "cat {}"

Yes, I think the same. That one works as expected: image

carlfriedrich commented 1 year ago

I don't see a preview, though. So does it behave identically to forgit (preview without tmux, no preview with tmux)? If that's the case, then this is not a forgit problem but a fzf problem and you should file an issue over there.

carmilso commented 1 year ago

I don't see a preview, though. So does it behave identically to forgit (preview without tmux, no preview with tmux)? If that's the case, then this is not a forgit problem but a fzf problem and you should file an issue over there.

Well, the preview is what you see below the ~ < 43/43 (0). So if I write for example index it will only show ./git/index as expected. It behaves the same in tmux and outside tmux: image

carlfriedrich commented 1 year ago

No, that's not the preview, it's the finder area. The preview window should show the file contents (that's what the preview command cat {} does):

grafik

carmilso commented 1 year ago

No, that's not the preview, it's the finder area. The preview window should show the file contents (that's what the preview command cat {} does):

grafik

Okay, it was because a bad configuration of fzf options the reason why that find | fzf --preview "cat {}" was not working. But it's curious because now it works from outside tmux but not from inside (it gives the same error as before) so as you say I assume it is some fzf misconfiguration with tmux and not forgit itself. I will investigate that.

Thanks for helping!