diff --git a/changelog/unreleased/issue-3111 b/changelog/unreleased/issue-3111 new file mode 100644 index 000000000..8eeabae36 --- /dev/null +++ b/changelog/unreleased/issue-3111 @@ -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 diff --git a/internal/ui/termstatus/terminal_windows.go b/internal/ui/termstatus/terminal_windows.go index 3788c1451..723aebdff 100644 --- a/internal/ui/termstatus/terminal_windows.go +++ b/internal/ui/termstatus/terminal_windows.go @@ -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 }