Use SIGWINCH to update terminal size
Instead of reading the terminal size on every status update, register for SIGWINCH to read and store the size when it changes. Test: status_test.go Change-Id: I555ad21a31a2c924ab0ca681e0c8f00df42a370a
This commit is contained in:
@@ -17,6 +17,7 @@ package terminal
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"syscall"
|
||||
"testing"
|
||||
|
||||
"android/soong/ui/status"
|
||||
@@ -260,6 +261,8 @@ func TestSmartStatusOutputWidthChange(t *testing.T) {
|
||||
|
||||
runner.startAction(action)
|
||||
smart.termWidth = 30
|
||||
// Fake a SIGWINCH
|
||||
stat.(*smartStatusOutput).sigwinch <- syscall.SIGWINCH
|
||||
runner.finishAction(result)
|
||||
|
||||
stat.Flush()
|
||||
|
Reference in New Issue
Block a user