mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-28 06:46:38 -04:00
Add exec bind action
This commit is contained in:
parent
b81b98d47c
commit
0c252d1b05
7 changed files with 43 additions and 10 deletions
17
input.c
17
input.c
|
|
@ -42,6 +42,7 @@
|
|||
#include "vt.h"
|
||||
#include "xmalloc.h"
|
||||
#include "xsnprintf.h"
|
||||
#include "slave.h"
|
||||
|
||||
struct pipe_context {
|
||||
char *text;
|
||||
|
|
@ -204,6 +205,22 @@ execute_binding(struct seat *seat, struct terminal *term,
|
|||
xdg_toplevel_set_fullscreen(term->window->xdg_toplevel, NULL);
|
||||
return true;
|
||||
|
||||
case BIND_ACTION_EXEC:
|
||||
if (binding->aux->type != BINDING_AUX_PIPE)
|
||||
return true;
|
||||
|
||||
int argc = 0;
|
||||
while(binding->aux->pipe.args[argc]) argc++;
|
||||
|
||||
if (slave_spawn(
|
||||
term->ptmx, argc, term->cwd, binding->aux->pipe.args, NULL,
|
||||
&term->conf->env_vars, term->conf->term, NULL, false, false, NULL) == -1) {
|
||||
LOG_ERRNO("failed to spawn slave for exec action");
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
case BIND_ACTION_PIPE_SCROLLBACK:
|
||||
if (term->grid == &term->alt)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue