-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restore useful compiler errors on dumb terminals #17158
restore useful compiler errors on dumb terminals #17158
Conversation
This reverts a part of 7cc4a69, and closes ziglang#16376. While the "correct" behavior on dumb terminals is still to be determined, this is arguably a major regression from 0.10.0 to 0.11.0, leaving users of various tools and CI platforms without any useful build logs. This change mirrors the behavior of basically every other compiler out there, which is to just not color the output (done implicitly in `std.io.tty`). Of course, the idea for machine-readable compiler errors still has merit, and with things like the to-be-implemented Zig compiler server [0] and ZLS, there are just better ways to go about it than to print somewhat useless error messages that a good portion of users will see. [0]: ziglang#615
04b3acf
to
7d90233
Compare
cc @andrewrk as the main proponent against this 🙂 |
There's an alternative to this, now that I look at it more. Given the following file: const std = @import("std");
pub fn main() void {
std.log.debug("");
}
which looks good enough! However, the example in #16376 still shows the case detailed there due to comptime shenanigans, which... is not great. We could move to displaying that example's error message to something like:
I'm not really thrilled about it, but we can always compromise if you're insistent on keeping the current behavior... |
I've been wrestling with this a few times. My scenario is Please let me add a different aspect: The main issue is that zig "derives" capabilities of the terminal from the TERM var itself, not from terminfo entries. Unfortunately, many programs do that, but on unix-y systems that has never been the "correct" way. Eg, on my system, I have proper entries for the above So there seem to be two ways that would solve all the different use cases:
I would be grateful for any feedback, whether either of these approaches would be acceptable.. In the case of 2., I might give it a try myself. If neither is, I will (once again) have to try and hack into Emacs to deal with more sequences that it did not want to handle. |
@ilohmar, meanwhile, here's a workaround to make Zig usable with Emacs
|
Thanks, I will try that! The patch to zig to use unicode chars will help me for all possible scenarios, anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see #16376 (comment). This does not resolve the issue.
This reverts a part of 7cc4a69, and closes #16376.
While the "correct" behavior on dumb terminals is still to be determined, this is arguably a major regression from 0.10.0 to 0.11.0, leaving users of various tools and CI platforms without any useful build logs.
This change mirrors the behavior of basically every other compiler out there, which is to just not color the output (done implicitly in
std.io.tty
).Of course, the idea for machine-readable compiler errors still has merit, and with things like the to-be-implemented Zig compiler server 0 and ZLS, there are just better ways to go about it than to print somewhat useless error messages that a good portion of users will see.