about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c6
-rw-r--r--src/command/cmd_defs.c12
-rw-r--r--src/command/cmd_funcs.c13
-rw-r--r--src/command/cmd_funcs.h1
4 files changed, 23 insertions, 9 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index d182e4db..527281a7 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -1116,11 +1116,7 @@ cmd_ac_init(void)
     autocomplete_add(executable_ac, "urlopen");
     autocomplete_add(executable_ac, "urlsave");
     autocomplete_add(executable_ac, "editor");
-    autocomplete_add(executable_ac, "vcard_photo");
-
-    executable_param_ac = autocomplete_new();
-    autocomplete_add(executable_param_ac, "set");
-    autocomplete_add(executable_param_ac, "default");
+    autocomplete_add(executable_ac, "async");
 
     intype_ac = autocomplete_new();
     autocomplete_add(intype_ac, "console");
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 9bc8b6f2..1aee5fb8 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2531,7 +2531,8 @@ static const struct cmd_t command_defs[] = {
               { "urlopen", cmd_executable_urlopen },
               { "urlsave", cmd_executable_urlsave },
               { "editor", cmd_executable_editor },
-              { "vcard_photo", cmd_executable_vcard_photo })
+              { "vcard_photo", cmd_executable_vcard_photo },
+              { "async", cmd_executable_async })
       CMD_TAGS(
               CMD_TAG_DISCOVERY)
       CMD_SYN(
@@ -2544,7 +2545,8 @@ static const struct cmd_t command_defs[] = {
               "/executable editor set <cmdtemplate>",
               "/executable editor default",
               "/executable vcard_photo set <cmdtemplate>",
-              "/executable vcard_photo default")
+              "/executable vcard_photo default",
+              "/executable async on|off")
       CMD_DESC(
               "Configure executable that should be called upon a certain command.")
       CMD_ARGS(
@@ -2557,7 +2559,8 @@ static const struct cmd_t command_defs[] = {
               { "editor set", "Set editor to be used with /editor. Needs a terminal editor or a script to run a graphical editor." },
               { "editor default", "Restore to default settings." },
               { "vcard_photo set", "Set executable that is run by /vcard photo open. Takes a command template that replaces %p with the path" },
-              { "vcard_photo default", "Restore to default settings." })
+              { "vcard_photo default", "Restore to default settings." },
+              { "async on|off", "Enable or disable async call of executables. Disable async if all executables run inside the TTY." })
       CMD_EXAMPLES(
               "/executable avatar xdg-open",
               "/executable urlopen set \"xdg-open %u\"",
@@ -2566,8 +2569,9 @@ static const struct cmd_t command_defs[] = {
               "/executable urlsave set \"wget %u -O %p\"",
               "/executable urlsave set \"curl %u -o %p\"",
               "/executable urlsave default",
+              "/executable editor set \"emacsclient -t\"",
               "/executable vcard_photo set \"feh %p\"",
-              "/executable editor set \"emacsclient -t\"")
+              "/executable async off")
     },
 
     { CMD_PREAMBLE("/url",
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;
+}
diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h
index 400261d3..53fa7f31 100644
--- a/src/command/cmd_funcs.h
+++ b/src/command/cmd_funcs.h
@@ -267,5 +267,6 @@ gboolean cmd_vcard_photo(ProfWin* window, const char* const command, gchar** arg
 gboolean cmd_vcard_refresh(ProfWin* window, const char* const command, gchar** args);
 gboolean cmd_vcard_set(ProfWin* window, const char* const command, gchar** args);
 gboolean cmd_vcard_save(ProfWin* window, const char* const command, gchar** args);
+gboolean cmd_executable_async(ProfWin* window, const char* const command, gchar** args);
 
 #endif