summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 19:26:27 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 19:26:27 (GMT)
commitc6c09ce7a38fccdc1cbbc847a80b98f107349fc7 (patch)
tree18aef62bdfc3db0629f3a1eaffa71f6a381c9bde
parent9175663f216a85f7c81c8080adbab872c74b6bd4 (diff)
Only try to send EOF to the shell, not other processes
-rw-r--r--src/Session.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Session.cpp b/src/Session.cpp
index 65bb220..14a0fbb 100644
--- a/src/Session.cpp
+++ b/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)) {