Make the kill feature works while in filtered mode

This commit is contained in:
nicolargo
2020-07-20 10:19:50 +02:00
parent 492db136d9
commit 5646379bd7
2 changed files with 7 additions and 1 deletions

View File

@@ -418,7 +418,8 @@ class _GlancesCurses(object):
self.args.cursor_position -= 1
elif self.pressedkey == curses.KEY_DOWN or self.pressedkey == 66:
# 'DOWN' > Down in the server list
if self.args.cursor_position < glances_processes.max_processes - 2:
# if self.args.cursor_position < glances_processes.max_processes - 2:
if self.args.cursor_position < glances_processes.processes_count:
self.args.cursor_position += 1
elif self.pressedkey == ord('\x1b') or self.pressedkey == ord('q'):
# 'ESC'|'q' > Quit

View File

@@ -176,6 +176,11 @@ class GlancesProcesses(object):
else:
return None
@property
def processes_count(self):
"""Get the current number of processes showed in the UI."""
return min(self._max_processes - 2, glances_processes.processcount['total'] - 1)
@property
def max_processes(self):
"""Get the maximum number of processes showed in the UI."""