Skip to content

Commit

Permalink
Merge pull request #56 from byung2/fix-resize
Browse files Browse the repository at this point in the history
Fix bugs when resizing a terminal
  • Loading branch information
moul authored Apr 11, 2018
2 parents b26a57e + 6e83010 commit f4e7938
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ func resetSignalSIGWINCH() {
}

func syscallTIOCGWINSZ() ([]byte, error) {
ws, err := unix.IoctlGetWinsize(0, 0)
ws, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
if err != nil {
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 {
return nil, fmt.Errorf("json.Marshal error: %v", err)
}
Expand Down

0 comments on commit f4e7938

Please sign in to comment.