Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

parent 9175663f
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment