dahlia / iterfzf

Pythonic interface to fzf, a CLI fuzzy finder
https://pypi.python.org/pypi/iterfzf
GNU General Public License v3.0
164 stars 19 forks source link

Raise exception when fzf gives 'Inappropriate ioctl for device' #24

Open crabdancing opened 3 years ago

crabdancing commented 3 years ago

In some contexts, fzf will immediately fail with 'inappropriate ioctl for device' (e.g., if you are on a non-interactive shell). From the code's perspective, this failure is silent and can only be inferred through the absence of a return value. I think it would be better to raise an exception so that it can be handled more gracefully, and to furthermore catch the error message so as to avoid side effects.

dahlia commented 3 years ago

Could you provide an instruction or code to reproduce it?

crabdancing commented 3 years ago

It happens when I attempt to test my program in PyCharm. When it tries to launch fzf, it fails to attach to the terminal since it's non-interactive.