summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2020-11-07 09:30:05 +0100
committernicolargo <nicolas@nicolargo.com>2020-11-07 09:30:05 +0100
commit1fc8c26c644d87b17b50dcdd82b4991942b58694 (patch)
treef747aa8dabf38d28806b7734df16d71d678d2a4d
parent08ce8e8c15c7184a01fd21e2333c5896deacf9af (diff)
parentb6469c6262958ec33d6008e083d330d5ae4a9686 (diff)
Merge branch 'Rattenkrieg-manual-refresh-1616' into develop
-rw-r--r--docs/cmds.rst2
-rw-r--r--docs/man/glances.15
-rw-r--r--glances/outputs/glances_curses.py6
3 files changed, 12 insertions, 1 deletions
diff --git a/docs/cmds.rst b/docs/cmds.rst
index a4c88179..b97734ce 100644
--- a/docs/cmds.rst
+++ b/docs/cmds.rst
@@ -375,6 +375,8 @@ The following commands (key pressed) are supported while in Glances:
Enable/disable mean GPU mode
``/``
Switch between process command line or command name
+``F5``
+ Refresh stats in curses user interface
In the Glances client browser (accessible through the ``--browser``
command line argument):
diff --git a/docs/man/glances.1 b/docs/man/glances.1
index 47dbd270..39a1171e 100644
--- a/docs/man/glances.1
+++ b/docs/man/glances.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "GLANCES" "1" "Oct 10, 2020" "3.1.6_b1" "Glances"
+.TH "GLANCES" "1" "Nov 07, 2020" "3.1.6_b1" "Glances"
.SH NAME
glances \- An eye on your system
.
@@ -479,6 +479,9 @@ Enable/disable mean GPU mode
.TP
.B \fB/\fP
Switch between process command line or command name
+.TP
+.B \fBF5\fP
+Refresh stats in curses user interface
.UNINDENT
.sp
In the Glances client browser (accessible through the \fB\-\-browser\fP
diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py
index 87764316..db52f257 100644
--- a/glances/outputs/glances_curses.py
+++ b/glances/outputs/glances_curses.py
@@ -387,6 +387,9 @@ class _GlancesCurses(object):
# ">" (right arrow) navigation through process sort
next_sort = (self.loop_position() + 1) % len(self._sort_loop)
glances_processes.set_sort_key(self._sort_loop[next_sort], False)
+ elif self.pressedkey == curses.KEY_F5:
+ # "F5" manual refresh requested
+ pass
# Return the key code
return self.pressedkey
@@ -981,6 +984,9 @@ class _GlancesCurses(object):
pressedkey = self.__catch_key(return_to_browser=return_to_browser)
# Is it an exit key ?
exitkey = (pressedkey == ord('\x1b') or pressedkey == ord('q'))
+ if pressedkey == curses.KEY_F5:
+ # were asked to refresh
+ return exitkey
if not exitkey and pressedkey > -1:
# Redraw display
self.flush(stats, cs_status=cs_status)