Skip to content

log: escape terminal control characters - #1114

Open
steadytao wants to merge 2 commits into
masterfrom
escape-terminal-controls
Open

steadytao wants to merge 2 commits into
masterfrom
escape-terminal-controls

Conversation

@steadytao

Copy link
Copy Markdown
Member

Fixes #1112

Summary

Prevent filenames and diagnostics from emitting terminal control characters through standard output or standard error. The output filter now validates permitted UTF-8 sequences, preserves ordinary valid UTF-8 and escapes raw or UTF-8-encoded C1 controls. DEL and malformed sequences are also handled safely.

Generic output no longer treats leading or trailing carriage returns as trusted framing. The three intentional progress displays now emit their carriage return through a dedicated helper.

Compatibility

Strict UTF-8 decoding applies only where rsync already permits 8 bit output. Default byte-oriented filtering remains unchanged. This does not depend on locale charset detection. It therefore avoids the BSD and macOS locale concern from an earlier private implementation.

@steadytao

Copy link
Copy Markdown
Member Author

@rubo77 please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

progress output prints filenames with C1 control characters unescaped, corrupting the terminal display

1 participant