Prior to this PR there was no TTY detection in the manager or tput package. The result was that during non-interactive executions escape sequences would also be written to the output stream. Additionally each frame would also be written.
For example, running the following would result in a messy log file:
go run examples/advanced/main.go |& tee log.log
This introduces changes that do the following:
If a TTY is not detected, do not render any spinner frames
If a TTY is not detected, do not write escape sequences
It is also possible to override the above by setting the environment variable YSMRR_FORCE_TTY to true. This will make ysmrr ignore tty detection and render frames and write escape sequences.
An example of the above override can be seen in the tput_test.go file.
Prior to this PR there was no TTY detection in the manager or tput package. The result was that during non-interactive executions escape sequences would also be written to the output stream. Additionally each frame would also be written.
For example, running the following would result in a messy log file:
This introduces changes that do the following:
It is also possible to override the above by setting the environment variable
YSMRR_FORCE_TTY
totrue
. This will make ysmrr ignore tty detection and render frames and write escape sequences.An example of the above override can be seen in the
tput_test.go
file.