I tried this:
Qt Code:
  1. env.insert("TERM", "xterm");
  2. processo.setProcessEnvironment(env);
  3.  
  4. //comando 1 - limpar a pasta
  5. comando = "echo";
  6. args.clear();
  7. args<<"$TERM";
  8. fullCommand = comando;
  9. for(int i = 0; i < args.count(); i++)
  10. fullCommand += " " + args.at(i);
  11. processo.start(comando,args,QIODevice::ReadOnly);
  12. processo.waitForFinished();
  13. stdOut = processo.readAllStandardOutput();
  14. stdError = processo.readAllStandardError();
  15. ui->commandTextEdit->append(fullCommand);
  16. ui->stdOutTextEdit->append(stdOut);
  17. ui->stdErrorTextEdit->append(stdError);
To copy to clipboard, switch view to plain text mode 

Using a system console i get:
Qt Code:
  1. root@srp:~# echo $TERM
  2. xterm
To copy to clipboard, switch view to plain text mode 

Using my code, in the ui->stdOutTextEdit e read:
Qt Code:
  1. $TERM
To copy to clipboard, switch view to plain text mode