m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

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 {})"
This commit is contained in:
Junegunn Choi
2021-03-25 19:56:18 +09:00
parent 6a1f3ec08b
commit f84b3de24b
3 changed files with 24 additions and 1 deletions

View File

@@ -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
}