config: add new key-binding 'quit', unbound by default

Closes #1475
This commit is contained in:
Daniel Eklöf 2024-04-10 19:26:23 +02:00
parent fa07c1ec67
commit b400903e25
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 13 additions and 1 deletions

View file

@ -55,8 +55,10 @@
* `cursor.unfocused-style=unchanged|hollow|none` to `foot.ini`. The
default is `hollow` ([#1582][1582]).
* New key binding: `quit` ([#1475][1475]).
[1582]: https://codeberg.org/dnkl/foot/issues/1582
[1475]: https://codeberg.org/dnkl/foot/issues/1475
### Changed

View file

@ -119,6 +119,7 @@ static const char *const binding_action_map[] = {
[BIND_ACTION_PROMPT_PREV] = "prompt-prev",
[BIND_ACTION_PROMPT_NEXT] = "prompt-next",
[BIND_ACTION_UNICODE_INPUT] = "unicode-input",
[BIND_ACTION_QUIT] = "quit",
/* Mouse-specific actions */
[BIND_ACTION_SCROLLBACK_UP_MOUSE] = "scrollback-up-mouse",

View file

@ -925,6 +925,9 @@ e.g. *search-start=none*.
Default: _Control+Shift+u_.
*quit*
Quit foot. Default: _none_.
# SECTION: search-bindings
This section lets you override the default key bindings used in

View file

@ -193,6 +193,7 @@
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
# quit=none
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none

View file

@ -444,6 +444,10 @@ execute_binding(struct seat *seat, struct terminal *term,
unicode_mode_activate(seat);
return true;
case BIND_ACTION_QUIT:
term_shutdown(term);
return true;
case BIND_ACTION_SELECT_BEGIN:
selection_start(
term, seat->mouse.col, seat->mouse.row, SELECTION_CHAR_WISE, false);

View file

@ -40,6 +40,7 @@ enum bind_action_normal {
BIND_ACTION_PROMPT_PREV,
BIND_ACTION_PROMPT_NEXT,
BIND_ACTION_UNICODE_INPUT,
BIND_ACTION_QUIT,
/* Mouse specific actions - i.e. they require a mouse coordinate */
BIND_ACTION_SCROLLBACK_UP_MOUSE,
@ -53,7 +54,7 @@ enum bind_action_normal {
BIND_ACTION_SELECT_QUOTE,
BIND_ACTION_SELECT_ROW,
BIND_ACTION_KEY_COUNT = BIND_ACTION_UNICODE_INPUT + 1,
BIND_ACTION_KEY_COUNT = BIND_ACTION_QUIT + 1,
BIND_ACTION_COUNT = BIND_ACTION_SELECT_ROW + 1,
};