Skip to content

Bracketed paste disabled after using fzf inside a zsh ZLE widget #4887

Closed

Description

@gulash007

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.73.1 (ce4bef7)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

zsh -f
function foo() { fzf >/dev/null; } && zle -N foo && bindkey '^XF' foo

Afterwards using the widget and exiting leads to disabled bracketed paste (noticeable fast-typing behavior, history backtracks char by char, pasting multiline input executes first line). First noticed when using fzf-history-widget.

Activity

  1. LangLangBart commented on Aug 4, 2026

    @LangLangBart
    Collaborator

    happens for bash as well.

    1. eval "$(fzf --bash)"
    2. press ⌃R + ⌃C
    3. copy and paste the two lines in the prompt
    echo first
    echo second
    bash-5.3$ eval "$(fzf --bash)"
    bash-5.3$ echo first
    first
    bash-5.3$ echo second

    there is a workaround we could apply in zsh; have not searched for bash solution

    --- a/shell/key-bindings.zsh
    +++ b/shell/key-bindings.zsh
    @@ -90,4 +90,5 @@ fzf-file-widget() {
       LBUFFER="${LBUFFER}$(__fzf_select)"
       local ret=$?
    +  (( $+zle_bracketed_paste )) && builtin print -r -n - $zle_bracketed_paste[1] >/dev/tty
       zle reset-prompt
       return $ret
    @@ -107,4 +108,5 @@ fzf-cd-widget() {
         FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=dir,follow,hidden --scheme=path" "${FZF_ALT_C_OPTS-} +m") \
         FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd) < /dev/tty)"
    +  (( $+zle_bracketed_paste )) && builtin print -r -n - $zle_bracketed_paste[1] >/dev/tty
       if [[ -z "$dir" ]]; then
         zle redisplay
    @@ -151,4 +153,5 @@ fzf-history-widget() {
       fi
       local ret=$?
    +  (( $+zle_bracketed_paste )) && builtin print -r -n - $zle_bracketed_paste[1] >/dev/tty
       local -a cmds
       # Avoid leaking auto assigned values when using backreferences '(#b)'

    Ref: https://zsh.org/mla/users/2017/msg00340.html


    fish

    • fish >=4 seems unaffected from this issue
    • fish <4 behaves like bash/zsh for the pasting example above
    • bisected to fish-shell/fish-shell@8164855

    nushell

    • not tested
  2. LangLangBart commented on Aug 4, 2026

    @LangLangBart
    Collaborator

    issue not reproducible with fzf <= 0.61.0

    refs: d22e75d

  3. junegunn commented on Aug 5, 2026

    @junegunn
    Owner

    happens for bash as well.

    1. eval "$(fzf --bash)"
    2. press ⌃R + ⌃C
    3. copy and paste the two lines in the prompt

    Thanks for the repro, I can confirm (had to remove --popup from my $FZF_DEFAULT_OPTS). What's strange, though, is that it starts working again on the second paste.

    1. paste again, and bracketed paste works

    This seems to explain why I felt conditional disable wasn't necessary in #4338 (comment).

  4. added 2 commits that reference this issue on Aug 10, 2026
    42afde5
    24de5e1
  5. added
    bug
    on Aug 10, 2026
  6. added a commit that references this issue on Aug 10, 2026
    dab626b
  7. gulash007 commented on Aug 16, 2026

    @gulash007
    Author

    Thank you 👍

  8. added a commit that references this issue on Aug 25, 2026
    324a813
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions