Skip to content

Prettyprinter seems to omit some newlines when to a tty #2290

Open
@thatch

Description

@thatch

Describe the bug

Missing newlines, perhaps before explicit map keys. When to a pipe, this works and produces valid yaml, but to a tty, not.

Version of yq: v4.45.1
Operating system: mac
Installed via: homebrew

Command
The command you ran:

$ echo -e '{}:\n{x}:\n[x]:'
{}:
{x}:
[x]:
$ echo -e '{}:\n{x}:\n[x]:' | yq . | cat
{}:
? {x: ''}
:
? [x]
:
$ echo -e '{}:\n{x}:\n[x]:' | yq .
{}:? {x: ''}:? [x]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions