aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--config.c2
-rw-r--r--doc/foot.ini.5.scd6
-rw-r--r--input.c14
-rw-r--r--wayland.h2
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
diff --git a/config.c b/config.c
index f50ee685..b247f3e9 100644
--- a/config.c
+++ b/config.c
@@ -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_.
diff --git a/input.c b/input.c
index 26af0807..f402fa3d 100644
--- a/input.c
+++ b/input.c
@@ -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;
diff --git a/wayland.h b/wayland.h
index 2d753e70..e593073e 100644
--- a/wayland.h
+++ b/wayland.h
@@ -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,