]> git.mdlowis.com Git - projs/tide.git/commitdiff
added cmd_exec hook for running programs interactively in preparation for implementin...
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 11 Nov 2019 21:35:45 +0000 (16:35 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 11 Nov 2019 21:35:45 +0000 (16:35 -0500)
.gitignore
src/lib/utf8.c
src/tide.c

index fb65b6b26cb01d7ebf63ccfc4f53bb2fa0915244..c229b4287d26fe406459bf9635a56e4e866555a2 100644 (file)
@@ -64,3 +64,4 @@ bin/tframe
 bin/anvil
 .rscons*
 build/
+bin/fetchsel
index 7305ed45b6ab80527e6c4ac7a648312f550b56a6..622dc67e5b5287256d44ef70c572f4b1b7805837 100644 (file)
@@ -119,7 +119,7 @@ bool risword(Rune r)
 
 bool rissigil(Rune r)
 {
-    return (r == ':' || r == '!' || r == '|' || r == '>' || r == '<');
+    return (r == ':' || r == '!' || r == '&' || r == '|' || r == '>' || r == '<');
 }
 
 bool risfile(Rune r)
index 938e75da9ba88bf3a1f9327e1d0724f0fd5a7f1a..d9ee15d309fc1bf794c8d725d8fbe8b196b28e93 100644 (file)
@@ -445,20 +445,38 @@ static void cmd_exec(char* cmd)
 
     /* 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)