redbear-power: show selected signal + target in kill dialog footer
Replace the generic kill-dialog footer with an explicit confirmation line: "Send SIGTERM to PID 1234 (sshd)? Enter: send Esc: cancel ↑↓: select". Extracts the signal name from the existing signal labels. Build, 224 tests, clippy, and fmt clean.
This commit is contained in:
@@ -149,8 +149,16 @@ impl Widget for &KillDialog {
|
||||
let help = if let Some(ref result) = self.result {
|
||||
Line::styled(result.clone(), Style::new().green().bold())
|
||||
} else {
|
||||
let signal_name = self
|
||||
.signals
|
||||
.get(self.selected.get())
|
||||
.and_then(|(label, _)| label.split(" — ").next())
|
||||
.unwrap_or("?");
|
||||
Line::styled(
|
||||
"Enter: send signal Esc: cancel ↑↓: select",
|
||||
format!(
|
||||
"Send {signal_name} to PID {} ({})? Enter: send Esc: cancel ↑↓: select",
|
||||
self.pid, self.comm
|
||||
),
|
||||
Style::new().dark_gray(),
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user