Skip to content

Zig no longer resets horizontal position in cmd.exe for compile error messages #20188

Closed
@rohlem

Description

@rohlem

Zig Version

0.13.0-dev.365+332fbb4b0

Steps to Reproduce and Observed Behavior

Tested on Microsoft Windows 11 Home, version 10.0.22000 Build 22000.
I just updated from 0.13.0-dev.211+6a65561e3 and noticed a difference in compile error output in cmd.exe.

C:\...>C:\use\Development\zig-windows-x86_64-0.13.0-dev.211+6a65561e3\zig test main.zig
main.zig:27:14: error: expected type 'void', found 'noreturn'
        .a, .b => |p| p, //non-inline shared prong with payload incorrectly triggers "expected type 'void', found 'noreturn'"
            ~^

C:\...>C:\use\Development\zig-windows-x86_64-0.13.0-dev.365+332fbb4b0\zig test main.zig
main.zig:27:14: error: expected type 'void', found 'noreturn'
                                                                     .a, .b => |p| p, //non-inline shared prong with payload incorrectly triggers "expected type 'void', found 'noreturn'"
                                                                              ~^

To me it looks like the horizontal position isn't reset; my guess would be that Zig is no longer outputting \r, and whatever else it is doing isn't working correctly for my cmd.exe.
For the record, on Windows Terminal (which I think is the same as PowerShell?) the output looks correct in both versions.

Expected Behavior

Correctly resetting the horizontal position on line breaks.

I'm not sure whether this is directly caused by #20172 - I tried manually reverting the change in lib/std/io/tty.zig , however the output of neither zig test nor of the on-demand-compiled zig fmt changed.
However, it's also possible that this error displaying logic is pre-compiled in both cases and so expectedly isn't affected by a change in userland std.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavioros-windowsregressionIt worked in a previous version of Zig, but stopped working.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions