fzf-tmux locks up tmux session when called from tmux's run-shell

Created on 27 Jan 2020  路  4Comments  路  Source: junegunn/fzf

  • [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

    • [x] Mac OS X

    • [ ] Windows

    • [ ] Etc.

  • Shell

    • [x] bash

    • [x] zsh

    • [ ] fish

Problem / Steps to reproduce

With tmux 3.0a and fzf-tmux 0.20.0.

  1. Inside a tmux shell, launch the tmux command-prompt (usually by running prefix then :).
  2. Type: run-shell fzf-tmux
  3. Result: the entire shell is completely locked. No keystrokes are accepted; I cannot ctrl-C to quit.

Note that if I disconnect from the session (usually by closing my entire terminal), then reconnect to the tmux session, everything is reanimated and I'm able to close the fzf-tmux split.

I've confirmed this result on both Fedora Linux and MacOS, using both bash and zsh.


A simple Dockerfile to reproduce it:

FROM linuxbrew/debian
RUN brew install tmux fzf
RUN echo "export PATH=/home/linuxbrew/.linuxbrew/bin/:\$PATH" >> .profile

Or, pull from docker.io and reproduce with these steps:

  1. Run docker run --rm -ti docker.io/mikehearn/tmux-fzf-freezing.
  2. In container, launch tmux
  3. Open command-prompt with CTRL+B then :
  4. Type run-shell fzf-tmux then hit Enter

Screencast of me doing these steps:

fzf-tmux-freezing

Most helpful comment

As of tmux 3.0a, it's necessary to supply the -b flag to run-shell to avoid the lockup:

run-shell -b ... fzf-tmux ...

Otherwise, tmux will wait for the command to exit before processing more input.

This solution and explanation can be found here: https://github.com/tmux/tmux/issues/2025#issuecomment-567849015

All 4 comments

Hello,

I've encountered the same problem with tmux 3.0 and also on 3.0a. 2.9a is fine so I've reverted back to that version for the time being.

I went ahead and tried to git bisect the problematic change on tmux. I think it's this change that was merged into the tmux 3.0 version: https://github.com/tmux/tmux/commit/33298d6df67e2ba3d90abdc94250eeaa963c3730

Weirdly enough, launching a second tmux client and attaching to the same session with tmux a gets it "unstuck" somehow.

Edit: I don't close the original client before attaching the second client which is a bit different than what @mike-hearn did. Both of the clients get unstuck after attaching the second client and inputting CTRL-C for example.

Good call. I just downgraded to tmux 2.9a and it does fix the lockup issue. Good short term solution until either fzf-tmux or tmux itself addresses whatever is causing this.

As of tmux 3.0a, it's necessary to supply the -b flag to run-shell to avoid the lockup:

run-shell -b ... fzf-tmux ...

Otherwise, tmux will wait for the command to exit before processing more input.

This solution and explanation can be found here: https://github.com/tmux/tmux/issues/2025#issuecomment-567849015

Yep, that fixed it. I didn't think to look at the tmux issue tracker, big oversight on my part. Thanks for letting me know!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leonklingele picture leonklingele  路  3Comments

jan-warchol picture jan-warchol  路  3Comments

sassanh picture sassanh  路  3Comments

alistaircolling picture alistaircolling  路  3Comments

ghost picture ghost  路  3Comments