about summary refs log tree commit diff
path: root/Src/Modules/zpty.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-25 20:48:52 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2013-08-25 20:48:52 +0100
commitf75904a3809bf3d9ef4f644ee5add09326a207a7 (patch)
treeeb9b1c5920fb2fa7cddabfc35d4d44f078761a5a /Src/Modules/zpty.c
parent935758ab7febbf1c46323d530fae2bae1dfd23d5 (diff)
downloadzsh-f75904a3809bf3d9ef4f644ee5add09326a207a7.tar.gz
zsh-f75904a3809bf3d9ef4f644ee5add09326a207a7.tar.xz
zsh-f75904a3809bf3d9ef4f644ee5add09326a207a7.zip
31665: zpty should attach terminal on slave.
Also add test.
Diffstat (limited to 'Src/Modules/zpty.c')
-rw-r--r--Src/Modules/zpty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 25ec7dfea..382119483 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -344,6 +344,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
 
 	if (get_pty(0, &slave))
 	    exit(1);
+	SHTTY = slave;
+	attachtty(mypid);
 #ifdef TIOCGWINSZ
 	/* Set the window size before associating with the terminal *
 	 * so that we don't get hit with a SIGWINCH.  I'm paranoid. */
@@ -398,6 +400,7 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock)
 	opts[INTERACTIVE] = 0;
 	execode(prog, 1, 0, "zpty");
 	stopmsg = 2;
+	mypid = 0; /* trick to ensure we _exit() */
 	zexit(lastval, 0);
     }
     master = movefd(master);