Re: [Vala] spawn like a terminal



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 <raster rastersoft com>:

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)
raster rastersoft com              http://www.rastersoft.com

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list




-- 
Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>

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

*Mon blog:* arteymix.github.io
*Mon projet de coopérative:* pittoresque.github.io
*Clé PGP:* B1AD6EA5
<https://pgp.mit.edu/pks/lookup?op=vindex&search=0x1CCFC3A2B1AD6EA5>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]