Output remove non-printing characters

The text output generated by the backup has non-printed (^M^[[2K^M^M^[[2K) characters using the system on Windows machines with cygwin. Is it possible to remove these characters? Look:

#restic -vvv backup ‘c:\DADOS\SERVIDOR\TI’ | cat -v

^M^[[2Kunchanged /c/DADOS/SERVIDOR/TI/
^M^[[2Kunchanged /c/DADOS/SERVIDOR/
^M^[[2Kunchanged /c/DADOS/
^M^[[2Kunchanged /c/
^M^[[2K^M^M^[[2KFiles: 0 new, 0 changed, 95 unmodified
^M^[[2K^M^M^[[2KDirs: 0 new, 0 changed, 9 unmodified
^M^[[2K^M^M^[[2KData Blobs: 0 new
^M^[[2K^M^M^[[2KTree Blobs: 0 new
^M^[[2K^M^M^[[2KAdded to the repo: 0 B
^M^[[2K^M^M^[[2Kprocessed 95 files, 373.217 MiB in 0:01
^M^[[2K^M^M^[[2Ksnapshot 4415f3b0 saved

These control characters and escape sequences are what makes restic output the text in a structured way, aren’t they?

What actual problem are you trying to solve? If you don’t print these using cat -v, what’s the problem? Are you trying to say that you are seeing these characters in plain text when you run restic in Cygwin on Windows?

Your example only shows when you pipe them through cat -v, which naturally makes them show since that’s the purpose of that command.

1 Like

AFAICT an issue was opened for this problem on Github, but the fix hasn’t been merged yet.

Could you test PR #3325 and see if it fixes the problem for you?

1 Like

Since restic does not have a direct log option for a file, something like --log-to-file, and it displays formatting, I need to delete the formatting to send to a file.