mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-11 18:22:00 -07:00
become: Set stdin to /dev/tty
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user