Merge pull request #3150 from MichaelEischer/fix-windows-redir-output

termstatus: Fix canUpdateStatus detection for redirected output on windows
This commit is contained in:
Alexander Neumann 2020-12-06 21:17:27 +01:00 committed by GitHub
commit ba31c6fdaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,9 @@
Bugfix: Correctly detect output redirection for `backup` command on Windows
On Windows, since restic 0.10.0 the `backup` command did not properly detect
when the output was redirected to a file. This caused restic to output
terminal control characters. This has been fixed by correcting the terminal
detection.
https://github.com/restic/restic/issues/3111
https://github.com/restic/restic/pull/3150

View File

@ -88,8 +88,8 @@ func canUpdateStatus(fd uintptr) bool {
return true
}
// check if the output file type is a pipe (0x0003)
if isPipe(fd) {
// check that the output file type is a pipe (0x0003)
if !isPipe(fd) {
return false
}