fzf icon indicating copy to clipboard operation
fzf copied to clipboard

[bash] kill completion not working

Open laur89 opened this issue 3 years ago • 6 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
    • [x] Linux
  • Shell
    • [x] bash

Problem / Steps to reproduce

This problem has been persistent for quite a few months now. kill used to work in following manner: a) in shell, type kill (ie "kill" followed by a space) b) press TAB c) processes were listed and selectable via fzf

Now the c) step produces following error:

 kill sed: couldn't write 246 items to stdout: Broken pipe
sed: couldn't write 284 items to stdout: Broken pipe

Display all 461 possibilities? (y or n)

It still works as expected if input in a) step is replaced by kill **


Is this expected?

Config/additional info

My ~/.bashrc contains line [ -f ~/.fzf.bash ] && source ~/.fzf.bash

~/.fzf.bash contents:

if [[ ! "$PATH" == */home/laur/.fzf/bin* ]]; then
  PATH="${PATH:+${PATH}:}/home/laur/.fzf/bin"
fi

# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/home/laur/.fzf/shell/completion.bash" 2> /dev/null

# Key bindings
# ------------
source "/home/laur/.fzf/shell/key-bindings.bash"
$ fzf --version
0.35.1 (b55f555)

$ bash --version
GNU bash, version 5.2.2(1)-release (x86_64-pc-linux-gnu)

Possibly related:

  • #1941
  • #1866
  • https://github.com/junegunn/fzf/issues/2716#issuecomment-1238301776

laur89 avatar Nov 23 '22 12:11 laur89

hi laur89.

Did you tweak you pipe maximum buffer size on your system recently? Here's the value I have on my Linux station for example:

cat /proc/sys/fs/pipe-max-size 
1048576

Delapouite avatar Nov 23 '22 13:11 Delapouite

Have the exact same value.

laur89 avatar Nov 23 '22 13:11 laur89

It still works as expected if input in a) step is replaced by kill **

Is this expected?

Yes. See https://github.com/junegunn/fzf/commit/52594355bfa63ce7d579c7961f4f2fb30b486101. kill completion without trigger sequence is no longer supported.

 kill sed: couldn't write 246 items to stdout: Broken pipe
sed: couldn't write 284 items to stdout: Broken pipe

However, this is not expected, and I can't reproduce the problem. You might want to examine what's going on by doing it again after ~~set +x~~ set -x.

junegunn avatar Nov 24 '22 00:11 junegunn

Will do later when I'm back at the computer. In the mean time, would you be kind and reply in the #2716 thread whether there's a sane rollback for this kill ~cmd~ behavior.

laur89 avatar Nov 24 '22 00:11 laur89

However, this is not expected, and I can't reproduce the problem. You might want to examine what's going on by doing it again after set +x.

Where should the debug be enabled? Doing it in the completion.bash, key-bindings.bash and complete shell itself didn't provide any extra logging.

Also something I just noticed - this sed error is only returned in a non-tmux shell. In tmux the output is:

kill <TAB>
Display all 502 possibilities? (y or n)

laur89 avatar Nov 24 '22 08:11 laur89

Where should the debug be enabled?

In your interactive shell. Type in set -x and the subsequent actions will print the commands that are run.

CORRECTION: it should be set -x, not set +x.

junegunn avatar Nov 27 '22 07:11 junegunn