Skip to content

Console.writeLine does not align correctly with characters that do not have width 1 #50

@mrcsh

Description

@mrcsh

When using Console.writeLine() to print strings that have either tabs or embedded ANSI codes. The resulting output is longer than the width of the screen so it appears that there are extra new lines but it's just the actual lines wrapped before the actual newline is printed.

I have worked around it with just using write() with an newline in the supplied string.

I double checked and the behavior is not present in 1.0. The change to have writeLine() call writeAligned() is likely the culprit and the non-single width characters are causing the alignment to be miscalculated.

I don't know this if this is even reasonable to fix as it would require knowing how the terminal is actually rendering the string.

So this is mostly to document, and suggest maybe changing current writeLine to writeLineAlinged and having writeLine behave as previously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions