microsoft / ntttcp-for-linux

A Linux network throughput multiple-thread benchmark tool.
https://github.com/Microsoft/ntttcp-for-linux
MIT License
361 stars 87 forks source link

Do not print escape sequences to stdout if terminal isn't a TTY #43

Closed lpereira closed 3 years ago

lpereira commented 4 years ago

When redirecting the output to a file, the real-time throughput information will be printed with escape sequences to clear the current line. This will make it difficult to look at the results later and see if the throughput changed during testing.

Print the escape sequence only if the terminal isn't a TTY, or if the $TERM environment variable isn't set to "dumb".

CC @harz566