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

[Feature improvement] Disable preview window from shellscript #1928

Open
5 of 10 tasks
yutkat opened this issue Mar 17, 2020 · 2 comments
Open
5 of 10 tasks

[Feature improvement] Disable preview window from shellscript #1928

yutkat opened this issue Mar 17, 2020 · 2 comments

Comments

@yutkat
Copy link

yutkat commented Mar 17, 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

I don't want to display the preview window when shellscript returns empty string.
I want to always display the preview window, But I want to control only the specific pattern from shellscript.

export FZF_DEFAULT_OPTS='--preview "~/.zsh/rc/myplugins/fzf-preview.sh {}"'
if [[ -e ${input} && $(file --mime ${input}) =~ /directory ]]; then
  ls -1 --color=always ${input}
elif [[ -e ${input} && $(file --mime ${input}) =~ binary ]]; then
  echo -ne "" # I don't want to show the preview window
elif [[ ${input} =~ .*:[[:digit:]]*:.* ]]; then
  # etc
fi
@yutkat yutkat changed the title [Feature request] Disable preview window from shellscript [Feature improvement] Disable preview window from shellscript Mar 17, 2020
@jandamm
Copy link

jandamm commented Mar 31, 2020

I was about to write a similar feature request.

Two issues I can see here is having the preview open and close when having a list where only some items have a preview.
Also when using cat an empty file wouldn't show a preview. This could be confusing.

@vovcacik
Copy link
Contributor

Hide preview window, when preview is empty string?

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

No branches or pull requests

3 participants