From ff4f44b22ae8d6522ee22599174a6cdd41bc0314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 5 Dec 2021 19:30:32 +0100 Subject: Pre-select the last sent signal in SignalsPanel Instead of pre-selecting SIGTERM every time, select the signal last send in the same htop session. Closes: #862 --- Action.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Action.c') diff --git a/Action.c b/Action.c index 07e21dca..92145330 100644 --- a/Action.c +++ b/Action.c @@ -344,9 +344,12 @@ static Htop_Reaction actionKill(State* st) { if (Settings_isReadonly()) return HTOP_OK; - Panel* signalsPanel = SignalsPanel_new(); + static int preSelectedSignal = SIGNALSPANEL_INITSELECTEDSIGNAL; + + Panel* signalsPanel = SignalsPanel_new(preSelectedSignal); const ListItem* sgn = (ListItem*) Action_pickFromVector(st, signalsPanel, 14, true); if (sgn && sgn->key != 0) { + preSelectedSignal = sgn->key; Panel_setHeader((Panel*)st->mainPanel, "Sending..."); Panel_draw((Panel*)st->mainPanel, false, true, true, State_hideFunctionBar(st)); refresh(); -- cgit v1.2.3