mirror of
https://github.com/KDE/konsole.git
synced 2026-06-11 07:26:10 -04:00
Fix when the name of a process called with sudo is not shown
Summary: Any process that is called in foreground with sudo (ex: sudo qtcreator) is identified by ProcessInfo::name only with the word sudo, being unable to identify which process it is. This fix makes it shows sudo along with the name of the process called. Reviewers: #konsole, hindenburg Reviewed by: #konsole, hindenburg Tags: #konsole Differential Revision: https://phabricator.kde.org/D12754
This commit is contained in:
@@ -365,6 +365,17 @@ void UnixProcessInfo::readProcessInfo(int pid)
|
||||
if (readProcInfo(pid)) {
|
||||
readArguments(pid);
|
||||
readCurrentDir(pid);
|
||||
|
||||
bool ok = false;
|
||||
const QString &processNameString = name(&ok);
|
||||
|
||||
if (ok && processNameString == QLatin1String("sudo")) {
|
||||
//Append process name along with sudo
|
||||
const QVector<QString> &args = arguments(&ok);
|
||||
|
||||
if (ok && args.size() > 1)
|
||||
setName(processNameString + QStringLiteral(" ") + args[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user