fix build in windows

This commit is contained in:
Cheney 2015-09-28 09:46:33 +08:00
parent 7537bea372
commit c814ccae9a
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -7,10 +7,6 @@ import (
"unsafe"
)
var (
StdinFd = syscall.Stdin
)
type winsize struct {
Row uint16
Col uint16

View File

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