mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 18:31:17 +08:00
3641993fab
Since rclone version 1.61.0 the tree command uses ANSI color sequences in output by default, but this lead to issues in Windows terminals that were not handling these (#6668). This commit ensures the tree command uses the terminal package for output. It relies on go-colorable to properly handle ANSI color sequences: If stdout is connected to a terminal the escape sequences are decoded and the text are written with color formatting using Windows Console API. If stdout is not connected to a terminal, e.g. redirected to file, the escape sequences are stripped off. The tree command has its own method for writing directly to a file, specified with flag --output, and then the output is not passed through the terminal package and must therefore be written without ansi codes. |
||
---|---|---|
.. | ||
testfiles | ||
tree_test.go | ||
tree.go |