This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v5 1/1] Cygwin: pty: add pseudo console support.


On Apr 15 00:23, Takashi Yano wrote:
> - Support pseudo console in PTY. Pseudo console is a new feature
>   in Windows 10 1809, which provides console APIs on virtual
>   terminal. With this patch, native console applications can work
>   in PTY such as mintty, ssh, gnu screen or tmux.
> ---
>  winsup/cygwin/dtable.cc               |  57 +++
>  winsup/cygwin/fhandler.h              |  42 +-
>  winsup/cygwin/fhandler_console.cc     |  32 ++
>  winsup/cygwin/fhandler_tty.cc         | 684 ++++++++++++++++++++++++--
>  winsup/cygwin/fork.cc                 |  24 +
>  winsup/cygwin/select.cc               |  22 +-
>  winsup/cygwin/spawn.cc                |  55 +++
>  winsup/cygwin/strace.cc               |  24 +
>  winsup/cygwin/tty.cc                  |   7 +
>  winsup/cygwin/tty.h                   |  23 +-
>  winsup/utils/cygwin-console-helper.cc |  14 +-
>  11 files changed, 940 insertions(+), 44 deletions(-)
> [...]
> diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
> index 35f8a59ae..b1eb5f3e4 100644
> --- a/winsup/cygwin/strace.cc
> +++ b/winsup/cygwin/strace.cc
> @@ -279,6 +279,30 @@ strace::vprntf (unsigned category, const char *func, const char *fmt, va_list ap
>  	      CloseHandle (h);
>  	    }
>  	}
> +#if 1 /* Experimental code */
> +      /* PTY with pseudo console cannot display data written to
> +	 STD_ERROR_HANDLE (output_handle) if the process is cygwin
> +	 process. output_handle works only in native console apps.
> +	 Therefore the data should be written to output_handle_cyg
> +	 as well. */

This is supposed to be combined with the preceeding code to a single
expression in the end, right?  I don't quite understand why writing
to STD_ERROR_HANDLE doesn't work.  Is STD_ERROR_HANDLE not connected
to the ConPty?

> +      fhandler_base *fh = ::cygheap->fdtab[2];
> +      if (fh && fh->get_major () == DEV_PTYS_MAJOR)

For a quick test if the process is connected to a pty, you can
use `if (istty_slave_dev (myself->ctty))'


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]