I sarts xterm from my program by using QProcess.
I need to send to xterm "tty" command and reads its output.
I try to do it a such way
terminalProc.start("xterm");
terminalProc.
setReadChannel(QProcess::StandardOutput);
terminalProc.waitForStarted(-1);
terminalProc.write("tty\n");
QByteArray result
= terminalProc.
readAllStandardOutput();
terminalProc.start("xterm");
terminalProc.setReadChannel(QProcess::StandardOutput);
terminalProc.waitForStarted(-1);
terminalProc.write("tty\n");
QByteArray result = terminalProc.readAllStandardOutput();
To copy to clipboard, switch view to plain text mode
But result is empty. What i am doing wrong?
Is there any other way to get value of tty?
Bookmarks