Log and CLI text: show control characters from repository content as visible escapes #143

Closed
opened 2026-11-10 19:04:26 +00:00 by james.maes · 0 comments
Owner

Problem

Text that comes from a repository (file paths in particular, which git allows to contain newlines and escape characters) is written unchanged to the activity log and, in the CLI's text modes, to the terminal:

  • a newline in such text starts a new line in the log, which reads as a separate entry (the Log window's "Errors only" view groups lines by their timestamp prefix);
  • escape sequences reach the terminal as-is.

The JSON output modes are not affected: the JSON encoder escapes these characters.

Scope

  • One helper that turns control characters, line and paragraph separators, and bidirectional-override characters into visible \uXXXX text.
  • FileActivityLog: the message is always one line; an exception's text keeps its lines, each one indented, so no line of it can look like the start of an entry.
  • CLI text output: repository names, error text, and path notes go through the helper.
  • Threat model updated.

Acceptance

Tests: a path with a newline and an escape character produces one log entry and visible escapes in CLI text output; ordinary text is unchanged. 100% line coverage holds; zero warnings; format clean.

## Problem Text that comes from a repository (file paths in particular, which git allows to contain newlines and escape characters) is written unchanged to the activity log and, in the CLI's text modes, to the terminal: - a newline in such text starts a new line in the log, which reads as a separate entry (the Log window's "Errors only" view groups lines by their timestamp prefix); - escape sequences reach the terminal as-is. The JSON output modes are not affected: the JSON encoder escapes these characters. ## Scope - One helper that turns control characters, line and paragraph separators, and bidirectional-override characters into visible `\uXXXX` text. - `FileActivityLog`: the message is always one line; an exception's text keeps its lines, each one indented, so no line of it can look like the start of an entry. - CLI text output: repository names, error text, and path notes go through the helper. - Threat model updated. ## Acceptance Tests: a path with a newline and an escape character produces one log entry and visible escapes in CLI text output; ordinary text is unchanged. 100% line coverage holds; zero warnings; format clean.
james.maes added the bugquality labels 2026-11-10 19:04:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/gclo#143