diff --git a/tee.go b/tee.go index ef858da..5aa17d9 100644 --- a/tee.go +++ b/tee.go @@ -3,7 +3,6 @@ package main import ( "bufio" "bytes" - "fmt" "io" "github.com/mattn/go-colorable" @@ -15,8 +14,9 @@ func tee(stdin io.Reader, stdout io.Writer) string { tee := io.TeeReader(stdin, &b1) s := bufio.NewScanner(tee) + s.Split(bufio.ScanBytes) for s.Scan() { - fmt.Fprintln(stdout, s.Text()) + stdout.Write(s.Bytes()) } uncolorize := colorable.NewNonColorable(&b2)