junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
61.95k stars 2.34k forks source link

execute(echo {}) does not work with tmux integration on v0.53.0 #3845

Closed mecab closed 4 weeks ago

mecab commented 4 weeks ago

Checklist

Output of fzf --version

0.53.0 (c4a9ccd)

OS

Shell

Problem / Steps to reproduce

After I upgraded to 0.53.0, I found execute(echo {}) does not print the selected line into the termianal when I use fzf with the tmux integration. Regardless of if I use the new --tmux option or traditional fzf-tmux wrapper, it does not work.

seq 5 | fzf --tmux --bind 'enter:execute(echo {})+abort'

seq 5 | fzf-tmux --bind 'enter:execute(echo {})+abort'

Expected behaviour

It opens fzf in a new tmux pane and shows the lines where each line has 1 to 5, and it prints the selected line to the terminal.

Observation

It opens fzf, but it does not print the selected line to the terminal.

I confirmed

seq 5 | fzf --bind 'enter:execute(echo {})+abort'

works as expected, and 0.52.0 does not have the issue.

I also confirmed

seq 5 | fzf --bind 'enter:execute(echo {} > /tmp/foo)+abort'

works as expected, creating /tmp/foo, which has the selected line as its content.

Other Note

I found

Process started by execute action now directly writes to and reads from /dev/tty. Manual /dev/tty redirection for interactive programs is no longer required

this line in the v0.53.0 Release Note which may or may not related to the issue, but I cannot find any workaround - tried execute(echo {} > /dev/stdout) but no joy.

junegunn commented 4 weeks ago

You can replace execute+abort with become.

See https://github.com/junegunn/fzf/discussions/3844#discussioncomment-9717412

mecab commented 4 weeks ago

@junegunn Thanks and sorry for wasting your time. I've searched the issues before raising this but missed it's already reported in the Discussion...