mirror of
https://github.com/rclone/rclone
synced 2024-12-27 19:43:48 +01:00
cmd: Don't print non-ASCII characters with --progress on windows - fixes #2501
This bug causes lots of strange behaviour with non-ASCII characters and --progress https://github.com/Azure/go-ansiterm/issues/26
This commit is contained in:
parent
bc8f0208aa
commit
8d72ef8d1e
@ -21,6 +21,15 @@ func writeToTerminal(b []byte) {
|
||||
winEventHandler := winterm.CreateWinEventHandler(os.Stdout.Fd(), os.Stdout)
|
||||
ansiParser = ansiterm.CreateParser("Ground", winEventHandler)
|
||||
})
|
||||
// Remove all non-ASCII characters until this is fixed
|
||||
// https://github.com/Azure/go-ansiterm/issues/26
|
||||
r := []rune(string(b))
|
||||
for i := range r {
|
||||
if r[i] >= 127 {
|
||||
r[i] = '.'
|
||||
}
|
||||
}
|
||||
b = []byte(string(r))
|
||||
_, err := ansiParser.Parse(b)
|
||||
if err != nil {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "\n*** Error from ANSI parser: %v\n", err)
|
||||
|
@ -681,6 +681,10 @@ with the `--stats` flag.
|
||||
This can be used with the `--stats-one-line` flag for a simpler
|
||||
display.
|
||||
|
||||
Note: On Windows until[this bug](https://github.com/Azure/go-ansiterm/issues/26)
|
||||
is fixed all non-ASCII characters will be replaced with `.` when
|
||||
`--progress` is in use.
|
||||
|
||||
### -q, --quiet ###
|
||||
|
||||
Normally rclone outputs stats and a completion message. If you set
|
||||
|
Loading…
Reference in New Issue
Block a user