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

Reload preview window on SIGWINCH (resize of window) #2248

Open
5 of 10 tasks
edi9999 opened this issue Nov 13, 2020 · 2 comments · May be fixed by #4002
Open
5 of 10 tasks

Reload preview window on SIGWINCH (resize of window) #2248

edi9999 opened this issue Nov 13, 2020 · 2 comments · May be fixed by #4002

Comments

@edi9999
Copy link
Contributor

edi9999 commented Nov 13, 2020

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

Run the following :

I run the following :

printf "%s\n" "ls" "vim" | fzf --preview 'man {} 2>/dev/null' --preview-window 'right:50%:nohidden'

I can see the man page show up in the right.

However, when I resize the window having fzf, the resize event does not cause a redraw in the preview window, meaning that the preview window shows only half of its capacity.

I don't know whether this should be made automatic or optional with a flag.

record_2020-11-13_103939

@junegunn
Copy link
Owner

fzf doesn't re-run the preview command on resize, so it just prints the previous result formatted for the previous width by man itself. You can restart the preview command using refresh-preview command.

fzf --preview 'date; echo $FZF_PREVIEW_COLUMNS' --bind space:refresh-preview

@haakonstorm
Copy link

Related: can the preview command be restarted and somehow be input the current number of lines currently shown in the fzf list? This would enable the preview window to grow semi-dynamically; which is natural: the list of candidates shrinks, you want more details about each one. I don't know any clever way of persisting this, but for my use case I use three sets of fzf-lists that inform each other (ctrl+G: context -> list of candidates in that context etc).

@gmou3 gmou3 linked a pull request Sep 19, 2024 that will close this issue
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