Merge pull request #56 from byung2/fix-resize
Fix bugs when resizing a terminal
This commit is contained in:
commit
f4e7938ff5
5
arch.go
5
arch.go
|
@ -20,11 +20,12 @@ func resetSignalSIGWINCH() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func syscallTIOCGWINSZ() ([]byte, error) {
|
func syscallTIOCGWINSZ() ([]byte, error) {
|
||||||
ws, err := unix.IoctlGetWinsize(0, 0)
|
ws, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("ioctl error: %v", err)
|
return nil, fmt.Errorf("ioctl error: %v", err)
|
||||||
}
|
}
|
||||||
b, err := json.Marshal(ws)
|
tws := winsize{Rows: ws.Row, Columns: ws.Col}
|
||||||
|
b, err := json.Marshal(tws)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("json.Marshal error: %v", err)
|
return nil, fmt.Errorf("json.Marshal error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue