You need a pseudo TTY (a.k.a PTY) to do that. You can check whether the
standard streams are attached to a TTY with 'Posix.isatty'.

I think that to make this easier, you should use libvte http://www.valadate.
org:8000/#!api=vte-2.91/Vte.Pty. If you need to redirect the command output
to a usable terminal, Vte also provide a GTK widget for that purpose. I
think it's what gnome-terminal uses.

I'm no expert here, so from now on, you'll have to read some manuals (e.g.
man pty).

2016-09-15 18:18 GMT-04:00 rastersoft <>:

> Hi all:
> I want to launch a process and receive its output. But this process (a
> "make" that runs valac and gcc) seems to detect whether it is running in
> a terminal or using pipes, and in the second case it refuses to send
> ANSI color codes. I want to receive that codes and show them in the
> text. How can I trick the application into thinking that it is in a
> terminal?
> Thanks.
> --
> Nos leemos
>                          RASTER    (Linux user #228804)
> _______________________________________________
> vala-list mailing list

Guillaume Poirier-Morency <>

Étudiant au baccalauréat en Informatique à l'Université de Montréal
Développeur d'application web

*Mon blog:*
*Mon projet de coopérative:*
*Clé PGP:* B1AD6EA5
vala-list mailing list

Reply via email to