From a7be1467bfd712922e9f58e0c4ea61e3de12f4d0 Mon Sep 17 00:00:00 2001 From: byung2 Date: Tue, 10 Apr 2018 14:50:09 +0900 Subject: [PATCH 1/2] Fix bug when resizing terminal --- arch.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch.go b/arch.go index 77a4dea..87b478a 100644 --- a/arch.go +++ b/arch.go @@ -24,7 +24,8 @@ func syscallTIOCGWINSZ() ([]byte, error) { 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) } From 6e830102b9e083232362829db47b9c840b50ec1a Mon Sep 17 00:00:00 2001 From: byung2 Date: Tue, 10 Apr 2018 14:51:39 +0900 Subject: [PATCH 2/2] Fix 'inappropriate ioctl for device' --- arch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch.go b/arch.go index 87b478a..a237d7f 100644 --- a/arch.go +++ b/arch.go @@ -20,7 +20,7 @@ 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) }