From c57dca709dfe1a9f7f6d745b924b9bd118511040 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 17 May 2020 12:16:16 +0200 Subject: [PATCH] First version when click on K --- glances/outputs/glances_curses.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py index 39ea3f62..e914f03c 100644 --- a/glances/outputs/glances_curses.py +++ b/glances/outputs/glances_curses.py @@ -636,6 +636,22 @@ class _GlancesCurses(object): self.display_popup('Process filter only available in standalone mode') self.edit_filter = False + # Display kill process confirmation popup + # Only in standalone mode (cs_status is None) + if self.kill_process and cs_status is None: + selected_process_raw = stats.get_plugin('processlist').get_raw()[ + self.args.cursor_position] + confirm = self.display_popup( + 'Kill process: {} (pid: {})\n\n Please confirm [Y]es / [N]o'.format( + selected_process_raw['name'], + selected_process_raw['pid']), + is_input=True) + elif self.kill_process and cs_status is not None: + self.display_popup( + 'Kill process only available in standalone mode') + self.kill_process = False + + # Display graph generation popup if self.args.generate_graph: self.display_popup('Generate graph in {}'.format(self.args.export_graph_path))