What is "dmd" Internal API, can I use it just like std Library Reference?

Daniel Kozak kozzi11 at gmail.com
Tue Aug 20 13:05:22 UTC 2019


On Tue, Aug 20, 2019 at 2:55 PM BoQsc via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:
>
> Hello everyone, again,
>
> I had an idea that I want some colors in the output of Command
> Line (For Windows) and
> the Terminal (For Linux)
>
> I found https://dlang.org/phobos/dmd_console.html and wanted to
> use it.
> But it seems I'm not being successful, and I do not understand
> why.
>
> Here, you can see that I'm trying to import dmd.console;
>
> > import std.stdio : writeln;
> > import dmd.console;
> >
> > void main()
> > {
> >     writeln("Hello World");
> > }
>
> And the output says that, dmd.console; do not exist?
> What are these Internal APIs for?
> > C:\Users\Juozas\Desktop>rdmd color.d
> > color.d(2): Error: module `console` is in file 'dmd\console.d'
> > which cannot be read

It is internal and it is part of dmd compiler sources but it is not
supposed to be used in normal D code. If you want colors in console
you can try this:
https://github.com/Kripth/terminal

you can use it as a dup dependency or just add terminal.d to your code base


More information about the Digitalmars-d-learn mailing list