Pseudo console support in PTY
Corinna Vinschen
corinna-cygwin@cygwin.com
Sat Mar 30 19:47:00 GMT 2019
Hi Takashi,
On Mar 30 22:08, Takashi Yano wrote:
> Hello cygwin developers,
>
> I have worked on implementing pseudo console support into cygwin
> PTY by request from Corinna. Pseudo console is a new feature
> after Windows 10 1809, which provides console APIs on virtual
> terminal.
> https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/
> https://docs.microsoft.com/en-us/windows/console/creating-a-pseudoconsole-session
>
> After much effort, it began to work partially. So, I would
> like to announce to this mailing list. Attached are the
> patchs against cygwin git HEAD.
\o/
Thanks a lot for doing this!
> Patch 0001 and 0002 are not really needed by the pseudo console
> support, but are the modification I have done at the same time.
>
> Patch 0001: This just renames and unifies the function names.
> Both get_io_handle() and get_handle() were identical and
> returned io_handle. So, they were unified.
This one is ok to be pushed to master as is.
> Patch 0002: This revises console code for better color handling
> and fixing select() behaviour. This provides 24 bit color
> support after Windows 10 build 14931. For legacy console,
> fake 256 color support is implemented, which use the nearest
> color from 16 system colors.
This patch is certainly a nice addition, but I'd prefer this to be split
into a patchset of at least 3 separate patches:
- Fix select
- Make console thread-safe
- Color code changes
These are three very different changes which should all stand on their
own. This also improves looking for bugs.
> Patch 0003: Support pseudo console in PTY. With this patch,
> native console applications can work in PTY such as mintty,
> ssh, gnu screen or tmux.
This patch is missing a bit of commenting. There are a couple of #if
0/1 blocks. It would be nice to know what these are good for (and
ultimately the #if 0/1's should go away). It would alos be helpful
if you see a chance to split this into a patchset with a few
self-contained, co-ordinated patches.
Apart from patch 1, which I'll push in a minute, please send any
patch submissions to cygwin-patches.
Thanks a lot for working on this. If all goes well we could even push
this into 3.1, together with Ken's FIFO patches.
This is all pretty exciting.
> Anyone who are interested in this work, please test. Any
> discussions and suggestions are also welcome.
>
> You can download the binaries from:
Already running your patches with self-built cygwin DLL and
cygwin-console-helper ;)
It seems the mintty startup is a bit slower than before, but
personally I could live with that.
> D=http://tyan0.dip.jp/cygwin
> ${D}/x86_64/test/cygwin1-20190330.dll.xz
> ${D}/x86_64/test/cygwin-console-helper.exe.xz
> ${D}/x86/test/cygwin1-20190330.dll.xz
> ${D}/x86/test/cygwin-console-helper.exe.xz
>
> This cygwin1.dll requires new cygwin-console-helper.exe.
> Please unxz and put them into /bin directory.
>
> Known problems:
> * Sometimes the screen layout would be broken.
> * mintty fails to start if it is started in console cygwin
> session.
Good to know, thanks!
Corinna
--
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20190330/73929d5c/attachment.sig>
More information about the Cygwin-developers
mailing list