Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, May 2008
Qt's QProcess and terminal escape sequences


Message 1 in thread

Hello!
Is it possible to capture terminal escape sequences from process'
stderr/out with QProcess?

--
 [ signature omitted ] 

Message 2 in thread

On Sun, May 4, 2008 at 5:15 PM, Matteo Bertozzi <theo.bertozzi@xxxxxxxxx> wrote:
> QByteArray QProcess::readAllStandardOutput ()
>  QByteArray QProcess::readAllStandardError ()

In fact I have Qt3 and it also have similar methods:
QByteArray QProcess::readStdout ()
QByteArray QProcess::readStderr ()

But I can't capture anything more than what could be done with stream
redirection.

--
 [ signature omitted ] 

Message 3 in thread

Dmitry Teslenko wrote:
>On Sun, May 4, 2008 at 5:15 PM, Matteo Bertozzi <theo.bertozzi@xxxxxxxxx> 
wrote:
>> QByteArray QProcess::readAllStandardOutput ()
>>  QByteArray QProcess::readAllStandardError ()
>
>In fact I have Qt3 and it also have similar methods:
>QByteArray QProcess::readStdout ()
>QByteArray QProcess::readStderr ()
>
>But I can't capture anything more than what could be done with stream
>redirection.

You capture everything that the process sent on those streams.

So there are only two options:
1) the process isn't sending the sequences
or 2) the process is sending on another stream.

Can you verify those hypotheses?

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 4 in thread

Dmitry Teslenko wrote:
> Hello!
> Is it possible to capture terminal escape sequences from process'
> stderr/out with QProcess?
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 

Most process detect, whether its standard streams are terminal
attached or not with "isatty" or "GetFileType" and won't generate
terminal sequences if not running on a terminal.
With the last version of Qt4.4 I haven't noticed any support for
pseudo-terminals and I guess QProcess is very much limited to the
weakest platform Qt supports and Windows has no pty.

--
 [ signature omitted ] 
begin:vcard
fn:Frank Mertens
n:Mertens;Frank
org:Cyblogic
adr:;;Anna-Siemsen-Str. 31;Jena;;07745;Germany
email;internet:frank@xxxxxxxxxxx
tel;work:+49 3641 295247
tel;cell:+49 17622390536
x-mozilla-html:FALSE
url:www.cyblogic.com
version:2.1
end:vcard


Message 5 in thread

On Sun, May 4, 2008 at 5:48 PM, Thiago Macieira
<thiago.macieira@xxxxxxxxxxxxx> wrote:
>  So there are only two options:
>  1) the process isn't sending the sequences
>  or 2) the process is sending on another stream.

2008/5/4 Frank Mertens <frank@xxxxxxxxxxx>:
>  Most process detect, whether its standard streams are terminal
>  attached or not with "isatty" or "GetFileType" and won't generate
>  terminal sequences if not running on a terminal.
>  With the last version of Qt4.4 I haven't noticed any support for
>  pseudo-terminals and I guess QProcess is very much limited to the
>  weakest platform Qt supports and Windows has no pty.

That for essential explanation. I guess further discussion of a
windows' pecularities lies out of scope of this mail list.
Thanks for guidance!

--
 [ signature omitted ]