From d5e4f367bfb9dd9d9a46f3082a3c3def72593424 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Tue, 2 Jun 2015 20:32:56 +0200 Subject: [PATCH] Short process name: fix for previous ...otherwise kernel threads will be highlighted too. --- glances/plugins/glances_processlist.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glances/plugins/glances_processlist.py b/glances/plugins/glances_processlist.py index db1564c6..422b1bd6 100644 --- a/glances/plugins/glances_processlist.py +++ b/glances/plugins/glances_processlist.py @@ -282,7 +282,10 @@ class Plugin(GlancesPlugin): cmdline = p['cmdline'] argument = ' '.join(cmdline.split()[1:]) try: - if cmdline == "" or args.process_short_name: + if cmdline == '': + msg = ' {0}'.format(p['name']) + ret.append(self.curse_add_line(msg, splittable=True)) + elif args.process_short_name: msg = ' {0}'.format(p['name']) ret.append(self.curse_add_line(msg, decoration='PROCESS', splittable=True)) msg = ' {0}'.format(argument) @@ -300,7 +303,7 @@ class Plugin(GlancesPlugin): msg = ' {0}'.format(argument) ret.append(self.curse_add_line(msg, splittable=True)) except UnicodeEncodeError: - ret.append(self.curse_add_line("", splittable=True)) + ret.append(self.curse_add_line('', splittable=True)) # Add extended stats but only for the top processes # !!! CPU consumption ???