提交 bb57b3ae 编写于 作者: N nicolargo

Electron/Atom processes displayed wrong in process list #1192

上级 28fc81bd
......@@ -25,7 +25,7 @@ Bugs corrected:
* OS specific arguments should be documented and reported #1180
* 'ascii' codec can't encode character u'\U0001f4a9' in position 4: ordinal not in range(128) #1185
* KeyError: 'memory_info' on stats sum #1188
* Electron processes displayed wrong in process list #1192
* Electron/Atom processes displayed wrong in process list #1192
Backward-incompatible changes:
......
......@@ -498,7 +498,9 @@ class _GlancesCurses(object):
ret = {}
for p in stats.getAllPlugins(enable=False):
if p == 'quicklook':
if p == 'quicklook' or p == 'processlist':
# processlist is done later
# because we need to know how many processes could be displayed
continue
# Compute the plugin max size
......@@ -538,7 +540,7 @@ class _GlancesCurses(object):
# Update the stats messages
###########################
# Update the client server status
# Get all the plugins but quicklook and proceslist
self.args.cs_status = cs_status
__stat_display = self.__get_stat_display(stats, layer=cs_status)
......@@ -560,6 +562,7 @@ class _GlancesCurses(object):
logger.debug("Set number of displayed processes to {}".format(max_processes_displayed))
glances_processes.max_processes = max_processes_displayed
# Get the processlist
__stat_display["processlist"] = stats.get_plugin(
'processlist').get_stats_display(args=self.args)
......
......@@ -44,9 +44,16 @@ def convert_timedelta(delta):
def split_cmdline(cmdline):
"""Return path, cmd and arguments for a process cmdline."""
cmdline_split = shlex.split(cmdline[0])
path, cmd = os.path.split(cmdline_split[0])
arguments = ' '.join(cmdline_split[1:])
# There is an issue in PsUtil for Electron/Atom processes (maybe others...)
# Tracked by https://github.com/nicolargo/glances/issues/1192
# https://github.com/giampaolo/psutil/issues/1179
# Add this dirty workarround (to be removed when the PsUtil is solved)
if len(cmdline) == 1:
cmdline = shlex.split(cmdline[0])
# /End of the direty workarround
path, cmd = os.path.split(cmdline[0])
arguments = ' '.join(cmdline[1:])
return path, cmd, arguments
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册