From 35351387a197e55f5389545efe3941b58ca94ffd Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Fri, 24 Mar 2023 14:56:35 +0000 Subject: /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 --- src/command/cmd_funcs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/command/cmd_funcs.c') 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; +} -- cgit 1.4.1-2-gfad0