diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-02-23 18:03:54 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-02-23 18:03:54 +0000 |
| commit | f869ca45467ce7d326deffcff7e270cbcc893d2c (patch) | |
| tree | f8a8c1469740a57e2839a9f42140352836a95d2c | |
| parent | commands: refactor scrollback up/down (diff) | |
config/input: add scrollback-home|end key bindings (unbound by default)
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | config.c | 2 | ||||
| -rw-r--r-- | doc/foot.ini.5.scd | 6 | ||||
| -rw-r--r-- | input.c | 14 | ||||
| -rw-r--r-- | wayland.h | 2 |
5 files changed, 26 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e85fb439..62e8a367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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", diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 7763a8b3..9127c015 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -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_. @@ -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; @@ -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, |
