mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-07 15:42:08 -07: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:
@@ -1723,7 +1723,7 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
|
||||
command := t.replacePlaceholder(template, forcePlus, string(t.input), list)
|
||||
cmd := util.ExecCommand(command, false)
|
||||
if !background {
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdin = tui.TtyIn()
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
t.tui.Pause(true)
|
||||
|
Reference in New Issue
Block a user