Skip to content

CRLF line endings corrupt the rendered box #70

Description

@Delta456

Description

Content with Windows line endings leaves a raw \r inside the box line. Width math stays consistent (\r measures 0), but on a terminal the carriage return jumps to column 0 and the right border overwrites the left edge.

Reproduction

out, _ := box.NewBox().Render("", "line one\r\nline two")
// out contains "│line one\r│"

Expected: \r\n normalized to \n before splitting — the approach lipgloss takes in Style.Render ("carriage returns can cause strange behaviour when rendering"); go-pretty similarly normalizes via text.ProcessCRLF.

Fix prepared locally; will land referencing this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions