whatcanGOwrong
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
package liner
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func (s *State) getColumns() bool {
|
||||
ws, err := unix.IoctlGetWinsize(unix.Stdout, unix.TIOCGWINSZ)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
s.columns = int(ws.Col)
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user