summaryrefslogtreecommitdiff
path: root/src/options.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-04-20 11:24:50 +0900
committerGitHub <noreply@github.com>2025-04-20 11:24:50 +0900
commit1d761684c510a04f78349e8e64aa7ebd26578807 (patch)
tree3c910e51b1e5e86c8ea9f01d817602f5c28a4cfd /src/options.go
parente491770f1c5f50cc969ff58228cd29a7cfa76663 (diff)
downloadfzf-1d761684c510a04f78349e8e64aa7ebd26578807.tar.gz
Add --tty-default=/dev/tty and --no-tty-default option (#4352)
Fix #4242. Use --no-tty-default, if you want fzf to perform a TTY look-up instead of defaulting to /dev/tty.
Diffstat (limited to 'src/options.go')
-rw-r--r--src/options.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go
index c250fb59..e94e82f9 100644
--- a/src/options.go
+++ b/src/options.go
@@ -631,6 +631,7 @@ type Options struct {
MEMProfile string
BlockProfile string
MutexProfile string
+ TtyDefault string
}
func filterNonEmpty(input []string) []string {
@@ -730,6 +731,7 @@ func defaultOptions() *Options {
WalkerOpts: walkerOpts{file: true, hidden: true, follow: true},
WalkerRoot: []string{"."},
WalkerSkip: []string{".git", "node_modules"},
+ TtyDefault: tui.DefaultTtyDevice,
Help: false,
Version: false}
}
@@ -2336,6 +2338,12 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
}
case "--no-tmux":
opts.Tmux = nil
+ case "--tty-default":
+ if opts.TtyDefault, err = nextString("tty device name required"); err != nil {
+ return err
+ }
+ case "--no-tty-default":
+ opts.TtyDefault = ""
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.