Strip escape characters when TERM=dumb

Bug: 111447427
Test: m nothing
Test: TERM=dumb m nothing
Test: m nothing | tee log
Change-Id: I041ec8a60e633393a145996d9ba7b5dae2880b06
This commit is contained in:
Dan Willemsen
2018-07-16 10:53:46 -07:00
parent dd41d7d631
commit 77fe361175

View File

@@ -82,8 +82,8 @@ func NewWriter(stdio StdioInterface) Writer {
if term, ok := os.LookupEnv("TERM"); ok && term != "dumb" {
w.smartTerminal = isTerminal(stdio.Stdout())
w.stripEscapes = !w.smartTerminal
}
w.stripEscapes = !w.smartTerminal
return w
}