I tried this:
env.insert("TERM", "xterm");
processo.setProcessEnvironment(env);
//comando 1 - limpar a pasta
comando = "echo";
args.clear();
args<<"$TERM";
fullCommand = comando;
for(int i = 0; i < args.count(); i++)
fullCommand += " " + args.at(i);
processo.
start(comando,args,
QIODevice::ReadOnly);
processo.waitForFinished();
stdOut = processo.readAllStandardOutput();
stdError = processo.readAllStandardError();
ui->commandTextEdit->append(fullCommand);
ui->stdOutTextEdit->append(stdOut);
ui->stdErrorTextEdit->append(stdError);
env.insert("TERM", "xterm");
processo.setProcessEnvironment(env);
//comando 1 - limpar a pasta
comando = "echo";
args.clear();
args<<"$TERM";
fullCommand = comando;
for(int i = 0; i < args.count(); i++)
fullCommand += " " + args.at(i);
processo.start(comando,args,QIODevice::ReadOnly);
processo.waitForFinished();
stdOut = processo.readAllStandardOutput();
stdError = processo.readAllStandardError();
ui->commandTextEdit->append(fullCommand);
ui->stdOutTextEdit->append(stdOut);
ui->stdErrorTextEdit->append(stdError);
To copy to clipboard, switch view to plain text mode
Using a system console i get:
root@srp:~# echo $TERM
xterm
root@srp:~# echo $TERM
xterm
To copy to clipboard, switch view to plain text mode
Using my code, in the ui->stdOutTextEdit e read:
$TERM
$TERM
To copy to clipboard, switch view to plain text mode
Bookmarks