aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bb.c b/bb.c
index 47a4bbf..a2dd99f 100644
--- a/bb.c
+++ b/bb.c
@@ -291,6 +291,11 @@ int run_script(bb_t *bb, const char *cmd)
setenv("BBDOTFILES", bb->show_dotfiles ? "1" : "", 1);
setenv("BBCURSOR", bb->nfiles ? bb->files[bb->cursor]->fullname : "", 1);
+ int ttyout, ttyin;
+ ttyout = open("/dev/tty", O_RDWR);
+ ttyin = open("/dev/tty", O_RDONLY);
+ dup2(ttyout, STDOUT_FILENO);
+ dup2(ttyin, STDIN_FILENO);
execvp("sh", args);
err("Failed to execute command: '%s'", cmd);
return -1;