about summary refs log tree commit diff stats
path: root/src/command/cmd_funcs.c
diff options
context:
space:
mode:
authorDaniel Santos <dacs.git@brilhante.top>2023-03-24 14:56:35 +0000
committerDaniel Santos <dan.git@brilhante.top>2023-07-01 10:08:20 +0100
commit35351387a197e55f5389545efe3941b58ca94ffd (patch)
tree87bba0f195ad83c9f895f91f1119cd099b954c71 /src/command/cmd_funcs.c
parentc402f8d9d2b3f94bbc20ba9c0c43f6df3b7ca885 (diff)
downloadprofani-tty-35351387a197e55f5389545efe3941b58ca94ffd.tar.gz
/executable async on|off
 * rename call_external() to call_external_async().
 * add call_external_fork(). This function makes all executable calls
to be forked and synchronous. So that running profanity inside a TTY,
we can set all executables to be TTY programs (fbi, mpv, w3m, emacs
eww, etc.), making possible to open urls or see images inside the TTY.
 * add '/executable async' command.
 * make call_external() use either call_external_async() or
call_external_fork(), according to the '/executable async'
configuration.

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r--src/command/cmd_funcs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index ffa8a3d2..f5535ad9 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -10864,3 +10864,16 @@ cmd_vcard_save(ProfWin* window, const char* const command, gchar** args)
     cons_show("User vCard uploaded");
     return TRUE;
 }
+
+gboolean
+cmd_executable_async(ProfWin* window, const char* const command, gchar** args)
+{
+    if (args[1] == NULL) {
+        cons_bad_cmd_usage(command);
+        return TRUE;
+    }
+
+    _cmd_set_boolean_preference(args[1], command, "Run executables asynchronously", PREF_EXECUTABLE_ASYNC);
+
+    return TRUE;
+}