configured FZF call fails since update from Cygwin 3.0.7 to 3.1.2

Trosi, Marco marco.trosi@continental-corporation.com
Fri Jan 17 09:43:00 GMT 2020


Hello everyone and a happy new year,

I updated recently Cygwin from 3.0.7 to 3.1.2, and now when I run "fzf" the following happens.

--- commandline call that fails --------------------------------------------
~ >> fzf
Traceback (most recent call last):
        4: from /usr/bin/fzf:1347:in `<main>'
        3: from /usr/bin/fzf:309:in `start'
        2: from /usr/bin/fzf:1157:in `start_loop'
        1: from /usr/bin/fzf:929:in `get_input'
/usr/bin/fzf:929:in `getc': No such process @ io_fillbuf - fd:11 /dev/tty (Errno::ESRCH)
--- end of commandline call that fails -------------------------------------

But it is important to understand that I don't use the default "find" for FZF.

Initially I wanted to use "fd", but "fd" is not available on Cygwin, so I use the Windows version of "fd".
I changed the FZF settings to ...

export FZF_DEFAULT_COMMAND='fd --type f'

... which works fine, still today.

But as I didn't like the Windows path format, I had the idea to run the "fd" output through "cygpath".
So I wrote a little wrapper script, named "fdc", to get Cygwin paths.

--- script named fdc -------------------------------------------------------
#!/usr/bin/bash
fd "$@" -X $(cygpath -aw $(which cygpath))
--- end of script named fdc ------------------------------------------------

and I changed my FZF settings in my bashrc accordingly ...

export FZF_DEFAULT_COMMAND='fdc --type f'

The "-X" executes a command, in this case "cygpath", for every found file.

Everything worked until I updated to Cygwin 3.1.2.


So I started to investigate to narrow down the problem.

FZF works with "fd" and with "find", so I thought it's connected to my "fdc" script.

I ran the command directly on commandline and it still works as usual.
Then I tried different variants in the script and directly on commandline.
Here the variants I tried.

--- script named fdc -------------------------------------------------------
#!/usr/bin/bash
fd "$@" -X $(cygpath -aw $(which cygpath))
#fd "$@" -X 'D:\Tools\cygwin\bin\cygpath.exe'
#fd "$@"
#fd -X 'D:\Tools\cygwin\bin\cygpath.exe'
--- end of script named fdc ------------------------------------------------

Still fails with "fdc".

Then I thought it could be the parameter passed to "fd" through "fdc",
so I also removed "--type f" from the settings.

--- FZF settings in bashrc -------------------------------------------------
export FZF_DEFAULT_COMMAND='fdc --type f' # fails
#export FZF_DEFAULT_COMMAND='fdc'         # fails
#export FZF_DEFAULT_COMMAND='fd'          # works
--- end of FZF settings in bashrc ------------------------------------------


Conclusion is that everything works on it's own (fd, fdc, unconfigured FZF, FZF configured with "fd"),
but when I configure FZF to use my "fdc" script it fails since the update, which wasn't the case with Cygwin 3.0.7.

For a brief moment the output is visible on screen, but it's so fast that I can't see if it is still with Windows paths
or Cygwin paths. I think it's the output due to the length on screen.


Unfortunately I can't give you the "cygcheck" output, but here some tool versions.
If you need specific information from the "cygcheck" output, then I can check them and decide if I can give them out.

--- tool versions ----------------------------------------------------------
~ >> fzf --version
fzf 0.8.9 (Dec 24, 2014)

~ >> fd --version
fd 7.3.0

~ >> mintty --version
mintty 3.1.0 (x86_64-pc-cygwin)
© 2013/2019 Andy Koppe / Thomas Wolff
License GPLv3+: GNU GPL version 3 or later
There is no warranty, to the extent permitted by law.

~ >> uname -a
CYGWIN_NT-10.0 NUL7231W 3.1.2(0.340/5/3) 2019-12-21 15:25 x86_64 Cygwin
--- end of tool versions ---------------------------------------------------


Have a great day,

Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list