Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ on:
paths-ignore:
- 'README.md'
- 'docs/**'
- '.github/ISSUE_TEMPLATE/**'
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'docs/**'
- '.github/ISSUE_TEMPLATE/**'

jobs:
# Check rustfmt
Expand Down
2 changes: 1 addition & 1 deletion docs/content/usage/widgets/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Note that key bindings are generally case-sensitive.
| ++down++ , ++j++ | Move down within a widget |
| ++g+g++ , ++home++ | Jump to the first entry in the table |
| ++G++ , ++end++ | Jump to the last entry in the table |
| ++d+d++ | Send a kill signal to the selected process |
| ++d+d++ , ++f9++ | Send a kill signal to 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 |
Expand Down
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1482,7 +1482,7 @@ impl App {
self.awaiting_second_char = false;
self.second_char = None;

self.start_dd();
self.start_killing_process();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down