Skip to content

Preview commands sometimes not being killed #4667

Description

@ErikReider

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.67.0 (Fedora)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Similar to #1384 which still seems to be an issue on my end. I started noticing this when my CPU would be pinned at 100% usage due to multiple less processes still running.

After some digging around, I was able to reproduce this issue by following these steps (took some tries on my laptop):

  1. Run echo PATH_TO_A_BINARY_FILE | fzf --preview 'less {}'
  2. Wait for around 10s
  3. Close fzf with Ctrl+c

It's interesting that when running less PATH_TO_A_BINARY_FILE, less would prompt with "may be a binary file. See it anyway?", but this doesn't lead to my high CPU usage + less still running after fzf exists. I'm not sure what fzf does in the background, but might that be the root cause?

This could easily be fixed on my end by running less with the -f flag, but this is still an edge-case that others might encounter.

Thanks for your time :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions