fzf icon indicating copy to clipboard operation
fzf copied to clipboard

error message about completion.bash in Kitty (fixable by adding set +o posix)

Open wturrell opened this issue 1 year ago • 2 comments

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

Info

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

Problem / Steps to reproduce

I frankly don't know if this is an fzf issue, a Kitty one or something unique to me (though I've checked all the obvious shell problems).

This was the error, when launching new windows in Kitty shell (but not in iTerm2 or PhpStorm terminal):

-bash: /opt/homebrew/opt/fzf/shell/completion.bash: line 279: syntax error near unexpected token <' -bash: /opt/homebrew/opt/fzf/shell/completion.bash: line 279: __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)' -bash: `fzf-file-widget': not a valid identifier

I tried with both the old (Apple) and newest (homebrew) versions of bash. I've read about similar problems with scripts running via sh when they should be using bash, but as you can see it's a bash error message.

I added set +o posix line 14 as per this suggestion https://stackoverflow.com/a/63397594/763419 and that has worked…

Any ideas? Thank you.

macOS Ventura 13.6, Kitty 0.31, fzf 0.44.1 (brew), bash (currently) 3.2.57

wturrell avatar Dec 25 '23 20:12 wturrell

I also use kitty but I don't have the problem and I have no idea what's going on. You might want to ask the maintainers of kitty, after replacing the fzf script with a simple line of code that can reproduce the problem. Something like:

cat <(echo)

junegunn avatar Dec 26 '23 01:12 junegunn

Youa re probably running the outdated bash provided by apple: https://github.com/kovidgoyal/kitty/issues/6926

kovidgoyal avatar Dec 26 '23 03:12 kovidgoyal