Skip to content

Weird behaviour when #4941

Closed
Closed

Description

@Timoses

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.74.5 (c0a193e)

OS

  • Linux
  • macOS
  • Windows

Shell

  • bash
  • zsh
  • fish
  • nushell
  • PowerShell

Problem / Steps to reproduce

  1. Open vim
  2. Press Space+o
  3. fzf correctly shown
  4. Press Escape
  5. :set title
  6. :set titlelen=2048
  7. Space+o

Now a 2 lines at the bottom appear containing:

C-O Show  Enter Open  C-X HSplit  C-V VSplit  C-T Tab' '--bind' 'ctrl-o:execute-silent:{ printf '\''%s'\'' {} | tr '\''\n'\'' '\''\1'\''; echo; } > '\''/tmp/nvim.timoses/nzk7Uq/2'\''' '--scheme' 'path' '-m' '--prompt' '~/.c/n/l/plugins/' '--preview' '/usr/bin/bash '\''/home/timoses/.local/share/nvim/lazy/fzf.vim/bin/preview.sh'\'' {}' '--bind' 'ctrl-/:toggle-preview' --expect=ctrl-v,ctrl-x,alt-enter,ctrl-t --no-height --no-tmux > /tmp/nvim.timoses/nzk7Uq) - 35,22-20      All

Screenshot:

Image

If using tabs in nvim, it will also show weird behaviour with tab headers in the tab heading line becoming invisible.

How did you run into this?

Running in Alacritty -> Tmux -> nvim

I have disabled all other plugins.

lazy.nvim config:

return {
  'junegunn/fzf.vim',
  dependencies = {
    'junegunn/fzf',
    --?init = 'fzf#install()'
  },
  --build = 'fzf#install()',
  build = function()
    vim.fn['fzf#install']()
  end,
  keys = {
      { "<leader>o", "<cmd>Files<cr>", desc = "FZF.vim" },
      { "<leader>g", "<cmd>Rg<cr>", desc = "FZF.vim Grep" },
      { "<leader>to", "<cmd>tabnew +Files<cr>", desc = "FZF.vim in new tab" },
      { "<leader>tg", "<cmd>tabnew +Rg<cr>", desc = "FZF.vim Grep in new tab" },
      { "<leader><leader>", "<cmd>Buffers<cr>", desc = "FZF.vim Buffers" },
  }
}

Activity

  1. junegunn commented on Oct 21, 2026

    @junegunn
    Owner

    Thanks for the report. I could reproduce it on Neovim 0.12.5 in tmux 3.8.

    Cause

    • fzf.vim passes the footer text with ANSI color codes (raw ESC bytes) on the command line.
    • Neovim names a terminal buffer term://{cwd}//{pid}:{command}, so the buffer name contains the ESC bytes.
    • With set title, Neovim writes the buffer name into the title escape sequence.
      • ESC in the file-name part is converted to ^[.
      • The (dir) part (the buffer name up to the last /) is not converted. The raw ESC ends the title sequence early, and the rest is printed on the screen.
    • When the title is too long, Neovim keeps only its end. With the default titlelen, the ESC bytes in fzf.vim commands are usually cut off. With titlelen=2048, they are not.

    Fix

    903a4da works around it in fzf. When 'title' is set and the command contains control characters, fzf runs the command from a temporary script, so the buffer name does not contain them.

    The root cause is in Neovim. It can be reproduced without fzf:

    nvim -u NONE
    :set title
    :enew | call termopen("echo \x1b[31mred\x1b[m after-escape /tmp/foo/bar; sleep 30")

    /tmp/foo) - Nvim is printed over the command line, even with the default titlelen. Vim is not affected because its terminal buffer name does not include the command.

  2. added a commit that references this issue on Oct 21, 2026
    903a4da
  3. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    neovim

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions