Only send EOF to known shells

The only processes that are "safe" or require us to send an EOF to
terminate cleanly are shells, so verify that people didn't run with -e
tmux or similar.

REVIEW: 128791
BUG: 367746
(cherry picked from commit ce4ab92249)
wilder-portage
Martin T. H. Sandsmark 10 years ago committed by Kurt Hindenburg
parent 391828aa23
commit 7cecfc078e
  1. 6
      src/Session.cpp

@ -822,8 +822,10 @@ bool Session::closeInNormalWay()
return true;
}
// Check if the default shell is running, in that case try sending an EOF for a clean exit
if (!isForegroundProcessActive()) {
static QSet<QString> knownShells({"ash", "bash", "csh", "dash", "fish", "hush", "ksh", "mksh", "pdksh", "tcsh", "zsh"});
// If only the session's shell is running, try sending an EOF for a clean exit
if (!isForegroundProcessActive() && knownShells.contains(QFileInfo(_program).fileName())) {
_shellProcess->sendEof();
if (_shellProcess->waitForFinished(1000)) {

Loading…
Cancel
Save