Skip to content

Conversation

@linusg
Copy link
Collaborator

@linusg linusg commented May 21, 2023

Closes #15804.

@linusg linusg force-pushed the std-io-tty branch 2 times, most recently from 4f8d700 to 1d614f9 Compare May 21, 2023 23:25
@linusg
Copy link
Collaborator Author

linusg commented May 21, 2023

I've pushed an update to make colors not bold by default (the ;1m), which kind of defeated the purpose of .bold. This affects compiler output, which I've decided to keep as-is. Basically, purposefully bold text actually stands out now - before and after:

image

image

Copy link
Member

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could std.io.detectTTYConfig be std.io.TTY.detectConfig instead?

@linusg linusg force-pushed the std-io-tty branch 3 times, most recently from 7aa64c8 to 5c2a45f Compare May 22, 2023 17:22
@linusg linusg requested a review from Vexu May 23, 2023 22:21
linusg added 4 commits May 24, 2023 10:15
Also get rid of the TTY wrapper struct, which was exlusively used as a
namespace - this is done by the tty.zig root struct now.

detectTTYConfig has been renamed to just detectConfig, which is enough
given the new namespace. Additionally, a doc comment had been added.
Also make colors not bold by default, that's what .bold is for.
@Vexu Vexu enabled auto-merge May 24, 2023 10:00
@Vexu Vexu merged commit 7cb2e65 into ziglang:master May 24, 2023
@linusg linusg deleted the std-io-tty branch May 24, 2023 13:24
// Per https://github.com/WebAssembly/WASI/issues/162 ANSI codes
// aren't currently supported.
return .no_color;
} else if (process.hasEnvVarConstant("ZIG_DEBUG_COLOR")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel right to introduce

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely moved, I didn't make any additions not mentioned in the proposal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like @andrewrk added it in 05f1ea3 to force color while capturing compiler output for docgen.zig.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Promote std.debug.TTY to non-debug functionality

5 participants