summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/actions.c b/src/actions.c
index 79db068..8917b85 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -34,6 +34,10 @@
#ifdef HAVE_LIBXTST
# include <X11/extensions/XTest.h>
#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
#define ARG_STRING(elt) args[elt]->string
@@ -2649,6 +2653,17 @@ spawn(char *cmd, int raw, rp_frame *frame)
if (setsid() == -1)
#endif
{
+#if defined (HAVE_SYS_IOCTL_H) && defined (TIOCNOTTY)
+ int ctty;
+
+ ctty = open ("/dev/tty", O_RDONLY);
+ if (ctty != -1)
+ {
+ ioctl (ctty, TIOCNOTTY);
+ close (ctty);
+ }
+#endif
+
#if defined (HAVE_SETPGID)
setpgid (0, 0);
#elif defined (HAVE_SETPGRP)