diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2021-03-25 19:56:18 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-03-25 20:00:09 +0900 |
| commit | f84b3de24b63e2e26cbfa2a24e61a4173824fffd (patch) | |
| tree | 25628bb12f52c80c0b9cd4173b7512ce32139001 /src/tui/ttyname_windows.go | |
| parent | 6a1f3ec08b3bbe11d527cd9b32ac6275df11dbf9 (diff) | |
| download | fzf-f84b3de24b63e2e26cbfa2a24e61a4173824fffd.tar.gz | |
Automatically set /dev/tty as STDIN on execute action
https://github.com/junegunn/fzf/issues/1360#issuecomment-788178140
# Redirect /dev/tty to suppress "Vim: Warning: Input is not from a terminal"
ls | fzf --bind "enter:execute(vim {} < /dev/tty)"
# With this change, we can omit "< /dev/tty" part
ls | fzf --bind "enter:execute(vim {})"
Diffstat (limited to 'src/tui/ttyname_windows.go')
| -rw-r--r-- | src/tui/ttyname_windows.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tui/ttyname_windows.go b/src/tui/ttyname_windows.go index 5354b747..8db490ad 100644 --- a/src/tui/ttyname_windows.go +++ b/src/tui/ttyname_windows.go @@ -2,6 +2,13 @@ package tui +import "os" + func ttyname() string { return "" } + +// TtyIn on Windows returns os.Stdin +func TtyIn() *os.File { + return os.Stdin +} |
