Only try to send EOF to the shell, not other processes

(cherry picked from commit c6c09ce7a3)
wilder-portage
Martin T. H. Sandsmark 10 years ago committed by Kurt Hindenburg
parent 5b72542305
commit 0303a98a29
  1. 13
      src/Session.cpp

@ -822,13 +822,18 @@ bool Session::closeInNormalWay()
return true;
}
_shellProcess->sendEof();
// Check if the default shell is running, in that case try sending an EOF for a clean exit
const QString defaultProc = program().split('/').last();
const QString currentProc = foregroundProcessName().split('/').last();
if (defaultProc == currentProc) {
_shellProcess->sendEof();
if (_shellProcess->waitForFinished(1000)) {
return true;
if (_shellProcess->waitForFinished(1000)) {
return true;
}
qWarning() << "shell did not close, sending SIGHUP";
}
qWarning() << "shell did not close, sending SIGHUP";
// We tried asking nicely, ask a bit less nicely
if (kill(SIGHUP)) {

Loading…
Cancel
Save