D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20788 - Difference between colored and non colored output
Summary: Difference between colored and non colored output
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-04-30 04:47 UTC by Andre
Modified: 2021-01-02 15:07 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andre 2020-04-30 04:47:36 UTC
The dmd output text is different depending whether color output is on or off.

Sample:

void main()
{
    int i;
    e = 3;
}

Color on:
sample.d(4): Error: undefined identifier e

Color off:
sample.d(4): Error: undefined identifier `e`

This is an issue if you want to use the dmd output for dustmite.
Color is on by default and very often I forgot, that I cannot just
use the output of dub (dmd) but have to disable colored output.

The dmd output text should be the same, independent whether color is
on or off.
Comment 1 RazvanN 2020-05-08 07:28:12 UTC
The output is the same, it just looks different in the terminal. If you redirect stderr to a file, regardless of the option of color (on/off) you will have the same output. It's just that when color is on, the backquotes are not displayed, instead the selected words are higlighted. I will close as invalid, but please reopen if you have a use case that is hindered by this.
Comment 2 Andre 2020-05-08 08:51:50 UTC
The issue is not about me, I know the behavior, but every other user will be very likely hit by this behavior and will think dustmite does not work.

It is not a display issue. If you copy the output into the clipboard also the necessary ticks are missing. Every user will learn by hard (wasting some time), he/she has to disable color outout if the output should be used for dustmite search.
Comment 3 ag0aep6g 2020-05-08 09:28:26 UTC
(In reply to RazvanN from comment #1)
> The output is the same, it just looks different in the terminal. If you
> redirect stderr to a file, regardless of the option of color (on/off) you
> will have the same output. It's just that when color is on, the backquotes
> are not displayed, instead the selected words are higlighted.

The output is not the same. You say it yourself: The backticks are missing in the colored output.

> I will close
> as invalid, but please reopen if you have a use case that is hindered by
> this.

Reopening. Andre has stated his use case: Copying from the terminal, pasting into a dustmite command. I think that's a valid concern, but it might not be deemed important enough to warrant a change. In that case, I suggest closing as WONTFIX instead of INVALID.
Comment 4 Dlang Bot 2020-05-08 09:29:00 UTC
@aG0aep6G created dlang/dmd pull request #11110 "fix issue 20788 - Difference between colored and non colored output" fixing this issue:

- fix issue 20788 - Difference between colored and non colored output

https://github.com/dlang/dmd/pull/11110
Comment 5 Dlang Bot 2021-01-02 15:07:29 UTC
dlang/dmd pull request #11110 "fix issue 20788 - Difference between colored and non colored output" was merged into master:

- 359824bf497ba8e07bd358b12a46b39201fea428 by aG0aep6G:
  fix issue 20788 - Difference between colored and non colored output

- 9dde9c3190952526fca713b0bc0e4e25afeaa45e by aG0aep6G:
  fixup! fix issue 20788 - Difference between colored and non colored output

https://github.com/dlang/dmd/pull/11110