summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hooks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hooks.c b/src/hooks.c
index a2bc8b2..b025f47 100644
--- a/src/hooks.c
+++ b/src/hooks.c
@@ -43,6 +43,7 @@ int run_hook(const char *name)
char *hook_path;
char const *arg[2];
int pid, ret = -127;
+ int prepare_wins = (ui_mode == UI_CURSES);
asprintf(&hook_path, "%s/%s", path_hooks, name);
arg[0] = hook_path;
@@ -51,7 +52,7 @@ int run_hook(const char *name)
if (!io_file_exists(hook_path))
return 0;
- if (ui_mode == UI_CURSES)
+ if (prepare_wins)
wins_prepare_external();
if ((pid = shell_exec(NULL, NULL, *arg, arg))) {
@@ -60,7 +61,7 @@ int run_hook(const char *name)
press_any_key();
}
- if (ui_mode == UI_CURSES)
+ if (prepare_wins)
wins_unprepare_external();
return ret;