diff --git a/plugin/fzf.vim b/plugin/fzf.vim index bd436e1..0396910 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -592,7 +592,7 @@ function! s:fzf_tmux(dict) end " Using native --tmux option - let in = (has_key(a:dict, 'source') ? '' : ' < /dev/tty') + let in = (has_key(a:dict, 'source') ? '' : ' --force-tty-in') return printf('%s --tmux %s%s', fzf#shellescape(fzf#exec()), size, in) endfunction diff --git a/src/options.go b/src/options.go index 461db31..9df1298 100644 --- a/src/options.go +++ b/src/options.go @@ -396,6 +396,7 @@ type Options struct { Output chan string NoWinpty bool Tmux *tmuxOptions + ForceTtyIn bool ProxyScript string Bash bool Zsh bool @@ -1949,6 +1950,12 @@ func parseOptions(opts *Options, allArgs []string) error { } case "--no-tmux": opts.Tmux = nil + case "--force-tty-in": + // NOTE: We need this because `system('fzf --tmux < /dev/tty')` doesn't + // work on Neovim. Same as '-' option of fzf-tmux. + opts.ForceTtyIn = true + case "--no-force-tty-in": + opts.ForceTtyIn = false case "--proxy-script": if opts.ProxyScript, err = nextString(allArgs, &i, ""); err != nil { return err diff --git a/src/proxy.go b/src/proxy.go index 5ee7317..bf7b78d 100644 --- a/src/proxy.go +++ b/src/proxy.go @@ -59,8 +59,8 @@ func runProxy(commandPrefix string, cmdBuilder func(temp string) *exec.Cmd, opts }() var command string - commandPrefix += ` --proxy-script "$0"` - if opts.Input == nil && util.IsTty(os.Stdin) { + commandPrefix += ` --no-force-tty-in --proxy-script "$0"` + if opts.Input == nil && (opts.ForceTtyIn || util.IsTty(os.Stdin)) { command = fmt.Sprintf(`%s > %q`, commandPrefix, output) } else { input, err := fifo("proxy-input")