Merge branch 'scrollback-key-bindings-pass-through-alt-screen'

Closes #573
This commit is contained in:
Daniel Eklöf 2021-06-05 10:33:55 +02:00
commit dfbe8297f7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 36 additions and 12 deletions

View file

@ -95,6 +95,9 @@
* Ignore auto-detected URLs that overlap with OSC-8 URLs.
* Default value for the `notify` option to use `-a ${app-id} -i
${app-id} ...` instead of `-a foot -i foot ...`.
* `scrollback-*`+`pipe-scrollback` key bindings are now passed through
to the client application when the alt screen is active
(https://codeberg.org/dnkl/foot/issues/573).
### Deprecated

45
input.c
View file

@ -88,28 +88,46 @@ execute_binding(struct seat *seat, struct terminal *term,
return true;
case BIND_ACTION_SCROLLBACK_UP_PAGE:
cmd_scrollback_up(term, term->rows);
return true;
if (term->grid == &term->normal) {
cmd_scrollback_up(term, term->rows);
return true;
}
break;
case BIND_ACTION_SCROLLBACK_UP_HALF_PAGE:
cmd_scrollback_up(term, max(term->rows / 2, 1));
return true;
if (term->grid == &term->normal) {
cmd_scrollback_up(term, max(term->rows / 2, 1));
return true;
}
break;
case BIND_ACTION_SCROLLBACK_UP_LINE:
cmd_scrollback_up(term, 1);
return true;
if (term->grid == &term->normal) {
cmd_scrollback_up(term, 1);
return true;
}
break;
case BIND_ACTION_SCROLLBACK_DOWN_PAGE:
cmd_scrollback_down(term, term->rows);
return true;
if (term->grid == &term->normal) {
cmd_scrollback_down(term, term->rows);
return true;
}
break;
case BIND_ACTION_SCROLLBACK_DOWN_HALF_PAGE:
cmd_scrollback_down(term, max(term->rows / 2, 1));
return true;
if (term->grid == &term->normal) {
cmd_scrollback_down(term, max(term->rows / 2, 1));
return true;
}
break;
case BIND_ACTION_SCROLLBACK_DOWN_LINE:
cmd_scrollback_down(term, 1);
return true;
if (term->grid == &term->normal) {
cmd_scrollback_down(term, 1);
return true;
}
break;
case BIND_ACTION_CLIPBOARD_COPY:
selection_to_clipboard(seat, term, serial);
@ -165,6 +183,9 @@ execute_binding(struct seat *seat, struct terminal *term,
return true;
case BIND_ACTION_PIPE_SCROLLBACK:
if (term->grid == &term->alt)
break;
/* FALLTHROUGH */
case BIND_ACTION_PIPE_VIEW:
case BIND_ACTION_PIPE_SELECTED: {
if (pipe_argv == NULL)