config: add pipe-command-output key-binding

This commit is contained in:
Daniel Eklöf 2022-12-08 11:45:23 +01:00
parent e9607de5ae
commit 1c70a84fde
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 99 additions and 5 deletions

View file

@ -227,7 +227,8 @@ execute_binding(struct seat *seat, struct terminal *term,
break;
/* FALLTHROUGH */
case BIND_ACTION_PIPE_VIEW:
case BIND_ACTION_PIPE_SELECTED: {
case BIND_ACTION_PIPE_SELECTED:
case BIND_ACTION_PIPE_COMMAND_OUTPUT: {
if (binding->aux->type != BINDING_AUX_PIPE)
return true;
@ -269,6 +270,10 @@ execute_binding(struct seat *seat, struct terminal *term,
len = text != NULL ? strlen(text) : 0;
break;
case BIND_ACTION_PIPE_COMMAND_OUTPUT:
success = term_command_output_to_text(term, &text, &len);
break;
default:
BUG("Unhandled action type");
success = false;