这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions terminal_size.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package uilive
Expand All @@ -10,8 +11,10 @@ import (
)

type windowSize struct {
rows uint16
cols uint16
row uint16
col uint16
xpixel uint16
ypixel uint16
}

var out *os.File
Expand All @@ -33,5 +36,5 @@ func getTermSize() (int, int) {
}
_, _, _ = syscall.Syscall(syscall.SYS_IOCTL,
out.Fd(), uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(&sz)))
return int(sz.cols), int(sz.rows)
return int(sz.col), int(sz.row)
}