forked from mirror/readline
fix build in windows
This commit is contained in:
parent
7537bea372
commit
c814ccae9a
5
utils.go
5
utils.go
|
@ -1,11 +1,16 @@
|
|||
package readline
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unicode"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
var (
|
||||
StdinFd = int(uintptr(syscall.Stdin))
|
||||
)
|
||||
|
||||
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||
func IsTerminal(fd int) bool {
|
||||
return terminal.IsTerminal(fd)
|
||||
|
|
|
@ -7,10 +7,6 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
var (
|
||||
StdinFd = syscall.Stdin
|
||||
)
|
||||
|
||||
type winsize struct {
|
||||
Row uint16
|
||||
Col uint16
|
||||
|
|
|
@ -33,7 +33,6 @@ type (
|
|||
)
|
||||
|
||||
var (
|
||||
StdinFd = 0
|
||||
kernel32 = syscall.NewLazyDLL("kernel32.dll")
|
||||
tmp_info console_screen_buffer_info
|
||||
|
||||
|
@ -63,5 +62,5 @@ func get_term_size(out syscall.Handle) coord {
|
|||
|
||||
// get width of the terminal
|
||||
func getWidth() int {
|
||||
return int(get_term_size(syscall.Stdin).x)
|
||||
return int(get_term_size(syscall.Stdout).x)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue