config/input: add scrollback-home|end key bindings (unbound by default)

This commit is contained in:
Daniel Eklöf 2022-02-23 19:03:54 +01:00
parent cb43c58150
commit f869ca4546
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 26 additions and 0 deletions

View file

@ -43,6 +43,8 @@
* OSC-22 - set xcursor pointer.
* Add "xterm" as fallback cursor where "text" is not available.
* `[key-bindings].scrollback-home|end` options.
### Changed

View file

@ -95,6 +95,8 @@ static const char *const binding_action_map[] = {
[BIND_ACTION_SCROLLBACK_DOWN_PAGE] = "scrollback-down-page",
[BIND_ACTION_SCROLLBACK_DOWN_HALF_PAGE] = "scrollback-down-half-page",
[BIND_ACTION_SCROLLBACK_DOWN_LINE] = "scrollback-down-line",
[BIND_ACTION_SCROLLBACK_HOME] = "scrollback-home",
[BIND_ACTION_SCROLLBACK_END] = "scrollback-end",
[BIND_ACTION_CLIPBOARD_COPY] = "clipboard-copy",
[BIND_ACTION_CLIPBOARD_PASTE] = "clipboard-paste",
[BIND_ACTION_PRIMARY_PASTE] = "primary-paste",

View file

@ -681,6 +681,12 @@ e.g. *search-start=none*.
*scrollback-down-line*
Scroll down/forward a single line in history. Default: _not bound_.
*scrollback-home*
Scroll to the beginning of the scrollback. Default: _not bound_.
*scrollback-end*
Scroll to the end (bottom) of the scrollback. Default: _not bound_.
*clipboard-copy*
Copies the current selection into the _clipboard_. Default: _Control+Shift+c_
_XF86Copy_.

14
input.c
View file

@ -134,6 +134,20 @@ execute_binding(struct seat *seat, struct terminal *term,
}
break;
case BIND_ACTION_SCROLLBACK_HOME:
if (term->grid == &term->normal) {
cmd_scrollback_up(term, term->grid->num_rows);
return true;
}
break;
case BIND_ACTION_SCROLLBACK_END:
if (term->grid == &term->normal) {
cmd_scrollback_down(term, term->grid->num_rows);
return true;
}
break;
case BIND_ACTION_CLIPBOARD_COPY:
selection_to_clipboard(seat, term, serial);
return true;

View file

@ -38,6 +38,8 @@ enum bind_action_normal {
BIND_ACTION_SCROLLBACK_DOWN_PAGE,
BIND_ACTION_SCROLLBACK_DOWN_HALF_PAGE,
BIND_ACTION_SCROLLBACK_DOWN_LINE,
BIND_ACTION_SCROLLBACK_HOME,
BIND_ACTION_SCROLLBACK_END,
BIND_ACTION_CLIPBOARD_COPY,
BIND_ACTION_CLIPBOARD_PASTE,
BIND_ACTION_PRIMARY_PASTE,