Skip to content
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

Disable diagnostics ANSI color for non-terminal #13

Merged
merged 1 commit into from
Oct 17, 2019
Merged

Disable diagnostics ANSI color for non-terminal #13

merged 1 commit into from
Oct 17, 2019

Conversation

dduan
Copy link
Collaborator

@dduan dduan commented Oct 5, 2019

If stdout is not a terminal device, don't color the output. This makes output in Vim quickfix buffer look much better since currently they are currently interleaved with ANSI code.

Alternative considered:

  • Use IsTTY.
  • Add a auto color option

Screen Shot 2019-10-16 at 2 53 57 PM

If stdout is not a terminal device, don't color the output.

Alternative considered:

* Use [IsTTY](https://github.com/dduan/istty).
* Add a auto color option
@dduan dduan merged commit 1dc8360 into llvm-swift:master Oct 17, 2019
@dduan dduan deleted the disable-colors branch October 17, 2019 01:03
dduan added a commit that referenced this pull request Nov 26, 2019
The change from #13 actually
disabled coloring when output device is a TTY device.

Excerpt from BSD manual for `isatty`:

```
RETURN VALUES
     The isatty() function returns 1 if fd refers to a terminal type
     device; otherwise, it returns 0 and may set errno to indicate the
     error.
```

:facepalm:

Anyways.
dduan added a commit that referenced this pull request Nov 26, 2019
The change from #13 actually
disabled coloring when output device is a TTY device.

Excerpt from BSD manual for `isatty`:

```
RETURN VALUES
     The isatty() function returns 1 if fd refers to a terminal type
     device; otherwise, it returns 0 and may set errno to indicate the
     error.
```

Double negative is hard. 🤦‍♀️

Anyways.
@dduan dduan mentioned this pull request Nov 26, 2019
dduan added a commit that referenced this pull request Nov 26, 2019
The change from #13 actually
disabled coloring when output device is a TTY device.

Excerpt from BSD manual for `isatty`:

```
RETURN VALUES
     The isatty() function returns 1 if fd refers to a terminal type
     device; otherwise, it returns 0 and may set errno to indicate the
     error.
```

Double negative is hard. 🤦‍♀️

Anyways.
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.

None yet

1 participant