/* get the selection that the command will operate on */
if (op && op != '<' && op != '!' && !view_selsize(win_view(EDIT)))
+ {
view_selectall(win_view(EDIT));
+ }
char* input = view_getstr(win_view(EDIT));
size_t len = (input ? strlen(input) : 0);
View *tags = win_view(TAGS), *edit = win_view(EDIT), *curr = win_view(FOCUSED);
/* execute the job */
- if (op == '!')
- free(input), job_start(execcmd, NULL, 0, NULL);
+ if (op == '!' || op == '&')
+ {
+ free(input);
+ if (op == '&')
+ {
+// xpty_init(win_view(EDIT), execcmd);
+ }
+ else
+ {
+ job_start(execcmd, NULL, 0, NULL);
+ }
+ }
else if (op == '>')
+ {
job_start(execcmd, input, len, tags);
+ }
else if (op == '|' || op == ':')
+ {
job_start(execcmd, input, len, edit);
+ }
else
+ {
job_start(execcmd, input, len, (op != '<' ? curr : edit));
+ }
}
static void exec(char* cmd, char* arg)