feature: add F9 as an alternative process kill key (#518)

Adds F9 as an alternative kill shortcut to dd.
This commit is contained in:
Clement Tsang
2021-06-22 20:34:00 -04:00
committed by GitHub
parent 2b4eba8f3c
commit 93b899e745
5 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -805,7 +805,7 @@ impl App {
self.proc_state.force_update = Some(self.current_widget.widget_id - 1);
}
} else {
self.start_dd()
self.start_killing_process()
}
}
}
@@ -1303,7 +1303,7 @@ impl App {
}
}
pub fn start_dd(&mut self) {
pub fn start_killing_process(&mut self) {
self.reset_multi_tap_keys();
if let Some(proc_widget_state) = self
@@ -1482,7 +1482,7 @@ impl App {
self.awaiting_second_char = false;
self.second_char = None;
self.start_dd();
self.start_killing_process();
}
}
+1 -1
View File
@@ -271,7 +271,7 @@ pub const CPU_HELP_TEXT: [&str; 2] = [
pub const PROCESS_HELP_TEXT: [&str; 15] = [
"3 - Process widget",
"dd Kill the selected process",
"dd, F9 Kill the selected process",
"c Sort by CPU usage, press again to reverse sorting order",
"m Sort by memory usage, press again to reverse sorting order",
"p Sort by PID name, press again to reverse sorting order",
+1
View File
@@ -124,6 +124,7 @@ pub fn handle_key_event_or_break(
KeyCode::F(3) => app.toggle_search_regex(),
KeyCode::F(5) => app.toggle_tree_mode(),
KeyCode::F(6) => app.toggle_sort(),
KeyCode::F(9) => app.start_killing_process(),
_ => {}
}
} else {