From aab6bdc3661e83216d2e4bc58948ed21d394d3f5 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 2 Jun 2015 07:47:25 +0200 Subject: 35357: FreeBSD needs HAVE_POSIX_OPENPT for zpty --- Src/Modules/zpty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Src/Modules/zpty.c') diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index 7b6130c6f..a77b0df75 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -154,7 +154,7 @@ getptycmd(char *name) return NULL; } -#ifdef USE_DEV_PTMX +#if defined(USE_DEV_PTMX) || defined(HAVE_POSIX_OPENPT) #ifdef HAVE_SYS_STROPTS_H #include -- cgit v1.2.3 From 4804a7c5ff144fc7cc974484d16f2f88cc131264 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 3 Jun 2015 23:53:47 +0200 Subject: 35360 (replacing 35357): fix for configuring zpty on FreeBSD without pty.ko loaded --- ChangeLog | 5 +++++ Src/Modules/zpty.c | 2 +- configure.ac | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Src/Modules/zpty.c') diff --git a/ChangeLog b/ChangeLog index 0ee19b99d..24ec700f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-06-03 Oliver Kiddle + + * 35360 (replacing 35357): configure.ac, Src/Modules/zpty.c: + fix for configuring zpty on FreeBSD without pty.ko loaded + 2015-06-03 Peter Stephenson * 35374: Test/D07multibyte.ztst: add tab expansion test with diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index a77b0df75..7b6130c6f 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -154,7 +154,7 @@ getptycmd(char *name) return NULL; } -#if defined(USE_DEV_PTMX) || defined(HAVE_POSIX_OPENPT) +#ifdef USE_DEV_PTMX #ifdef HAVE_SYS_STROPTS_H #include diff --git a/configure.ac b/configure.ac index 6a99aec1d..d7db8ba8d 100644 --- a/configure.ac +++ b/configure.ac @@ -2526,7 +2526,7 @@ dnl these is by defining _GNU_SOURCE. dnl ------- AH_TEMPLATE([USE_DEV_PTMX], [Define to 1 if all the kit for using /dev/ptmx for ptys is available.]) -if test x$ac_cv_have_dev_ptmx = xyes && \ +if test x$ac_cv_have_dev_ptmx = xyes -o x$ac_cv_func_posix_openpt = xyes && \ test x$ac_cv_func_grantpt = xyes && \ test x$ac_cv_func_unlockpt = xyes && \ test x$ac_cv_func_ptsname = xyes; then -- cgit v1.2.3 From a01f29c11de0df084a9a1e6b932b2937936d2119 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Tue, 11 Aug 2015 08:48:48 -0700 Subject: 36092: return the zpty master file descriptor in $REPLY for use with "zle -F" etc. --- ChangeLog | 3 +++ Doc/Zsh/mod_zpty.yo | 9 +++++++++ Src/Modules/zpty.c | 2 ++ 3 files changed, 14 insertions(+) (limited to 'Src/Modules/zpty.c') diff --git a/ChangeLog b/ChangeLog index c2274718b..59ed6f638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-08-11 Barton E. Schaefer + * 36092: Doc/Zsh/mod_zpty.yo, Src/Modules/zpty.c: return the pty + master file descriptor in $REPLY for use with "zle -F" etc. + * 36090: Src/init.c: keep signals queued for preprompt() 2015-08-11 Oliver Kiddle diff --git a/Doc/Zsh/mod_zpty.yo b/Doc/Zsh/mod_zpty.yo index 340f98314..44b375a3c 100644 --- a/Doc/Zsh/mod_zpty.yo +++ b/Doc/Zsh/mod_zpty.yo @@ -18,6 +18,15 @@ characters are echoed. With the tt(-b) option, input to and output from the pseudo-terminal are made non-blocking. + +The shell parameter tt(REPLY) is set to the file descriptor assigned to +the master side of the pseudo-terminal. This allows the terminal to be +monitored with ZLE descriptor handlers (see ifzman(zmanref(zshzle))\ +ifnzman(noderef(Zle Builtins))) or manipulated with tt(sysread) and +tt(syswrite) (see ifzman(THE ZSH/SYSTEM MODULE in zmanref(zshmodules))\ +ifnzman(noderef(The zsh/system Module))). em(Warning): Use of tt(sysread) +and tt(syswrite) is em(not) recommended, use tt(zpty -r) and tt(zpty -w) +unless you know exactly what you are doing. ) item(tt(zpty) tt(-d) [ var(name) ... ])( The second form, with the tt(-d) option, is used to delete commands diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c index 7b6130c6f..12e42b5bd 100644 --- a/Src/Modules/zpty.c +++ b/Src/Modules/zpty.c @@ -463,6 +463,8 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) #endif errno == EINTR)); + setiparam("REPLY", master); + return 0; } -- cgit v1.2.3