summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-28 19:25:28 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-05-28 19:27:31 +0900
commit782de139c8edd8c3e77022ddf71648db1b344079 (patch)
tree03f32fc90d0215458ab1b51b47aa5c8e41308722 /src
parent32eb32ee5e80ab4e10ead9bc6db8c6ad59cf509d (diff)
downloadfzf-782de139c8edd8c3e77022ddf71648db1b344079.tar.gz
[vim] Native --tmux fix for Neovim
Diffstat (limited to 'src')
-rw-r--r--src/options.go7
-rw-r--r--src/proxy.go4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/options.go b/src/options.go
index 461db313..9df1298e 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 5ee7317c..bf7b78d5 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")