mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-15 05:33:58 -04:00
input: pass through scrollback-* key bindings when alt screen is activw
Since the alt screen have no scrollback, all scrollback-* actions are effectively no-ops when the alt screen is active. Make them available to the client application instead. Closes #573
This commit is contained in:
parent
b5515a414a
commit
a7e2e4bfa9
2 changed files with 36 additions and 12 deletions
|
|
@ -95,6 +95,9 @@
|
||||||
* Ignore auto-detected URLs that overlap with OSC-8 URLs.
|
* Ignore auto-detected URLs that overlap with OSC-8 URLs.
|
||||||
* Default value for the `notify` option to use `-a ${app-id} -i
|
* Default value for the `notify` option to use `-a ${app-id} -i
|
||||||
${app-id} ...` instead of `-a foot -i foot ...`.
|
${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
|
### Deprecated
|
||||||
|
|
|
||||||
45
input.c
45
input.c
|
|
@ -88,28 +88,46 @@ execute_binding(struct seat *seat, struct terminal *term,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_UP_PAGE:
|
case BIND_ACTION_SCROLLBACK_UP_PAGE:
|
||||||
cmd_scrollback_up(term, term->rows);
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_up(term, term->rows);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_UP_HALF_PAGE:
|
case BIND_ACTION_SCROLLBACK_UP_HALF_PAGE:
|
||||||
cmd_scrollback_up(term, max(term->rows / 2, 1));
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_up(term, max(term->rows / 2, 1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_UP_LINE:
|
case BIND_ACTION_SCROLLBACK_UP_LINE:
|
||||||
cmd_scrollback_up(term, 1);
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_up(term, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_DOWN_PAGE:
|
case BIND_ACTION_SCROLLBACK_DOWN_PAGE:
|
||||||
cmd_scrollback_down(term, term->rows);
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_down(term, term->rows);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_DOWN_HALF_PAGE:
|
case BIND_ACTION_SCROLLBACK_DOWN_HALF_PAGE:
|
||||||
cmd_scrollback_down(term, max(term->rows / 2, 1));
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_down(term, max(term->rows / 2, 1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_SCROLLBACK_DOWN_LINE:
|
case BIND_ACTION_SCROLLBACK_DOWN_LINE:
|
||||||
cmd_scrollback_down(term, 1);
|
if (term->grid == &term->normal) {
|
||||||
return true;
|
cmd_scrollback_down(term, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case BIND_ACTION_CLIPBOARD_COPY:
|
case BIND_ACTION_CLIPBOARD_COPY:
|
||||||
selection_to_clipboard(seat, term, serial);
|
selection_to_clipboard(seat, term, serial);
|
||||||
|
|
@ -165,6 +183,9 @@ execute_binding(struct seat *seat, struct terminal *term,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case BIND_ACTION_PIPE_SCROLLBACK:
|
case BIND_ACTION_PIPE_SCROLLBACK:
|
||||||
|
if (term->grid == &term->alt)
|
||||||
|
break;
|
||||||
|
/* FALLTHROUGH */
|
||||||
case BIND_ACTION_PIPE_VIEW:
|
case BIND_ACTION_PIPE_VIEW:
|
||||||
case BIND_ACTION_PIPE_SELECTED: {
|
case BIND_ACTION_PIPE_SELECTED: {
|
||||||
if (pipe_argv == NULL)
|
if (pipe_argv == NULL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue