D12754: Fix when the name of a process called with sudo is not shown.
Kurt Hindenburg
noreply at phabricator.kde.org
Thu May 10 14:04:45 UTC 2018
hindenburg added a comment.
Something like this - I threw this together quickly - it needs looked at more closely
diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp
index 410682b..e588d1d 100644
- a/src/ProcessInfo.cpp
+++ b/src/ProcessInfo.cpp
@@ -365,6 +365,16 @@ 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")) {
+ const QVector<QString> &args = arguments(&ok);
+
+ if (ok && args.size() > 1) {
+ setName(processNameString + QStringLiteral(" ") + args[1]);
+ }
+ }
}
}
REPOSITORY
R319 Konsole
REVISION DETAIL
https://phabricator.kde.org/D12754
To: cjlcarvalho, #konsole, hindenburg
Cc: konsole-devel, herrold, ngraham, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20180510/07517766/attachment.html>
More information about the konsole-devel
mailing list