]> git.lyx.org Git - features.git/blobdiff - src/support/Systemcall.cpp
Restore line buffered output at least on posix systems. I failed to do
[features.git] / src / support / Systemcall.cpp
index 20813e794876acb2d9322e67c14cf25d1f4562f6..ec3f5a2258b1d5db8224f26c7ce7f03d28e65826 100644 (file)
@@ -60,6 +60,12 @@ int Systemcall::startscript(Starttype how, string const & what)
 #else
        QString cmd = QString::fromLocal8Bit(what.c_str());
        QProcess * process = new QProcess;
+#ifndef WIN32
+       if (isatty(1))
+               process->setStandardOutputFile(toqstr("/dev/stdout"));
+       if (isatty(2))
+               process->setStandardErrorFile(toqstr("/dev/stderr"));
+#endif
        process->start(cmd);
        if (!process->waitForStarted(3000)) {
                LYXERR0("Qprocess " << cmd << " did not start!");
@@ -86,8 +92,10 @@ int Systemcall::startscript(Starttype how, string const & what)
                LYXERR0("state " << process->state());
                LYXERR0("status " << process->exitStatus());
        }
+#ifdef WIN32
        cout << fromqstr(QString::fromLocal8Bit(process->readAllStandardOutput().data())) << endl;
        cerr << fromqstr(QString::fromLocal8Bit(process->readAllStandardError().data())) << endl;
+#endif
        killProcess(process);
        return exit_code;
 #endif