mirror of https://github.com/Llewellynvdm/fzf.git
become: Set stdin to /dev/tty
This commit is contained in:
parent
9e9c0ceaf4
commit
4e305eca26
|
@ -2876,6 +2876,7 @@ func (t *Terminal) Loop() {
|
|||
if t.history != nil {
|
||||
t.history.append(string(t.input))
|
||||
}
|
||||
util.SetStdin(tui.TtyIn())
|
||||
syscall.Exec(shellPath, []string{shell, "-c", command}, os.Environ())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// ExecCommand executes the given command with $SHELL
|
||||
|
@ -45,3 +47,7 @@ func SetNonblock(file *os.File, nonblock bool) {
|
|||
func Read(fd int, b []byte) (int, error) {
|
||||
return syscall.Read(int(fd), b)
|
||||
}
|
||||
|
||||
func SetStdin(file *os.File) {
|
||||
unix.Dup2(int(file.Fd()), 0)
|
||||
}
|
||||
|
|
|
@ -81,3 +81,7 @@ func SetNonblock(file *os.File, nonblock bool) {
|
|||
func Read(fd int, b []byte) (int, error) {
|
||||
return syscall.Read(syscall.Handle(fd), b)
|
||||
}
|
||||
|
||||
func SetStdin(file *os.File) {
|
||||
// No-op
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue