Fzf: FZF issue in tmux

Created on 22 Mar 2017  路  11Comments  路  Source: junegunn/fzf

  • Category

    • [x] fzf binary

    • [x] fzf-tmux script

    • [ ] Key bindings

    • [ ] Completion

    • [ ] Vim

    • [ ] Neovim

    • [ ] Etc.

  • OS

    • [ ] Linux

    • [x] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [x] bash

    • [x] zsh

    • [x] fish

The first item in the result is prefixed by some weird characters

?Ptmux;??]1337;CursorShape=0??\

fzf version 0.16.6
tmux 2.3

This only happens in tmux. I have tried both fzf and fzf-tmux commands

Most helpful comment

@kozie placing it before fish_vi_key_bindings in ~/.config/fish/config.fish fixed it for me:

function fish_vi_cursor; end
fish_vi_key_bindings

All 11 comments

I'm not familiar with that CursorShape=0. Is it from your configuration?
Also, what is the value of $TERM? Does it start with screen-?

Dunno where the CursorShape is coming from. i also tried with clean install of tmux with no custom config but got same result

echo $TERM
screen-256color

I looked into this issue a bit more and i m convinced this is not related to fzf but its due to iTerm setting up CursorShape when starting the tmux server. If I start a clean tmux session from another emulator like terminal or alacrity the issue does not appear (which i can use as as workaround as well). The escape codes link is probably a clue to fix it but not something i was able to do. Thank for looking into this issue though.

I use iterm2 but I don't have the issue. Please let me know if you find out more about the issue, thanks.

I had this issue when using the fish shell, and it could be an issue with how the fish shell sets the cursor shape for different vi modes. As a workaround, you can disable different cursor displays for different vi modes in the fish shell by adding the following to your ~/.config/fish/config.fish file:

function fish_vi_cursor; end

and/or

function __fish_cursor_1337; end

I'm having similar issues where i can not seem to use :GFiles in a tmux environment using fish shell.

I tried the above but adding the fish_vi_cursor function doesn't seem to do anything and adding __fish_cursor_1337 breaks my tmux by not starting a shell anymore within tmux. I tried adding them both and individually.

The only solution that seems to work good enough for me is using term xterm-256color within tmux instead of screen-256color but i'm pretty convinced that there is a better solution :)

@kozie placing it before fish_vi_key_bindings in ~/.config/fish/config.fish fixed it for me:

function fish_vi_cursor; end
fish_vi_key_bindings

Holy nuts.. I did that while also setting the tmux term back to screen-256color and it seems to work! :) Thanks a bunch!

perfect! placing it before invoking the vi bindings in fish config fixed it for me as well. Thanks @blaxill and @deanashton

thank you @deanashton ! i had same issue but when using prettier in nvim.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fenuks picture fenuks  路  3Comments

firedev picture firedev  路  3Comments

alistaircolling picture alistaircolling  路  3Comments

nordlow picture nordlow  路  3Comments

asilvadesigns picture asilvadesigns  路  3Comments