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 package readline
import ( import (
"syscall"
"unicode" "unicode"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
) )
var (
StdinFd = int(uintptr(syscall.Stdin))
)
// IsTerminal returns true if the given file descriptor is a terminal. // IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd int) bool { func IsTerminal(fd int) bool {
return terminal.IsTerminal(fd) return terminal.IsTerminal(fd)

View File

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

View File

@ -33,7 +33,6 @@ type (
) )
var ( var (
StdinFd = 0
kernel32 = syscall.NewLazyDLL("kernel32.dll") kernel32 = syscall.NewLazyDLL("kernel32.dll")
tmp_info console_screen_buffer_info tmp_info console_screen_buffer_info
@ -63,5 +62,5 @@ func get_term_size(out syscall.Handle) coord {
// get width of the terminal // get width of the terminal
func getWidth() int { func getWidth() int {
return int(get_term_size(syscall.Stdin).x) return int(get_term_size(syscall.Stdout).x)
} }