Skip to content

[BUG] Clear Line ASCII escape code at the beginning of every log line #11727

@mathieu-lemay

Description

@mathieu-lemay

Description

When looking at the logs for a container, every line now starts with the [2K ASCII code. This is causing issues when I try to pipe logs to jq.
I managed to narrow down the issue to this change.

Steps To Reproduce

  1. Run a container that outputs json
  2. Run the following command: docker compose logs --no-log-prefix <container> | jq
  3. Notice jq can't parse the line: jq: parse error: Invalid numeric literal at line 1, column 2

Alternatively

  1. Run a container
  2. Run the following command: docker compose logs --no-log-prefix <container> | hd -n 128
  3. Notice these 4 bytes at the start: 1b 5b 32 4b (.[2K

Compose Version

Docker Compose version v2.25.0-15-ge9dc8201

Docker Environment

n/a

Anything else?

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions