View mode: basic / threaded / horizontal-split · Log in · Help
March 17, 2012
dcaflib
In a post from a few weeks ago, someone mentioned terminal 
colors. Currently, I have one that works with bash (cmd pending) 
at https://github.com/carlor/dcaflib.

Example code:

import dcaflib.ui.terminal;

import std.stdio;

void main() {
    fgColor = TermColor.RED;
    writeln("this is red!");
    fgColor = TermColor.BLUE;
    writeln("this is blue!");
}
March 18, 2012
Re: dcaflib, unix terminal
On Saturday, 17 March 2012 at 03:00:36 UTC, Nathan M. Swan wrote:
> In a post from a few weeks ago, someone mentioned terminal 
> colors. Currently, I have one that works with bash (cmd 
> pending) at https://github.com/carlor/dcaflib.
>
> Example code:
>
> import dcaflib.ui.terminal;
>
> import std.stdio;
>
> void main() {
>     fgColor = TermColor.RED;
>     writeln("this is red!");
>     fgColor = TermColor.BLUE;
>     writeln("this is blue!");
> }

This worked for me with Ubuntu. Though I had to use rdmd instead
of dmd.

I'm using a version like this for Windows for one of my programs.

I've found with unix OS's you can't edit text very nice at all
using readln(); etc. Windows doesn't have that problem. I don't
even bother with stuff because of it.

-Joel
March 26, 2012
Re: dcaflib
Nathan M. Swan wrote:

> In a post from a few weeks ago, someone mentioned terminal
> colors. Currently, I have one that works with bash (cmd pending)
> at https://github.com/carlor/dcaflib.
> 
> Example code:
> 
> import dcaflib.ui.terminal;
> 
> import std.stdio;
> 
> void main() {
>      fgColor = TermColor.RED;
>      writeln("this is red!");
>      fgColor = TermColor.BLUE;
>      writeln("this is blue!");
> }

Nathan, what terminals are supported? Only ANSI / VT* or some other types of 
terminals as well?
March 26, 2012
Re: dcaflib
On Monday, 26 March 2012 at 13:56:46 UTC, Dejan Lekic wrote:
> Nathan, what terminals are supported? Only ANSI / VT* or some 
> other types of
> terminals as well?

I've only tested it on OSX Terminal, but I read about the 
features on a Linux website, and have used the "ANSI escape code" 
Wikipedia article as reference, so I assume it's ANSI.

NMS
Top | Discussion index | About this forum | D home