Commit c2a0e4cf authored by Adriaan de Groot's avatar Adriaan de Groot 💬 Committed by Kurt Hindenburg
Browse files

Special-case PID 0 on FreeBSD

PID 0 is the kernel; when the shell exits, the process ID for
the session becomes 0. Downstream bug report
parent 3b3dd14d
......@@ -1620,10 +1620,20 @@ int Session::foregroundProcessId()
bool Session::isForegroundProcessActive()
const auto pid = processId();
const auto fgid = _shellProcess->foregroundProcessGroup();
// On FreeBSD, after exiting the shell, the foreground GID is
// an invalid value, and the "shell" PID is 0. Those are not equal,
// so the check below would return true.
if (pid == 0) {
return false;
// This check is wrong when Konsole is started with '-e cmd'
// as there will only be one process.
// See BKO 134581 for no popup when closing session
return (processId() != _shellProcess->foregroundProcessGroup());
return (pid != fgid);
QString Session::foregroundProcessName()
Supports Markdown
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