diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-12-05 19:30:32 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-12-05 19:36:36 +0100 |
commit | ff4f44b22ae8d6522ee22599174a6cdd41bc0314 (patch) | |
tree | 26e9955df773dfae0e92f751a645c69d996c9280 /Action.c | |
parent | a38f48481edeb696b2973c8a1bb2107658108a41 (diff) |
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
Diffstat (limited to 'Action.c')
-rw-r--r-- | Action.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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(); |