[PATCH 0/4] Improve pseudo console support.

2021-01-21 Thread Takashi Yano via Cygwin-patches
The new implementation of pseudo console support by commit bb428520 provides the important advantages, while there also has been several disadvantages compared to the previous implementation. These patches overturn some of them. The disadvantage: 1) The cygwin program which calls console API dir

[PATCH 1/4] Cygwin: pty: Inherit typeahead data between two input pipes.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- PTY has a problem that the key input, which is typed during windows native app is running, disappears when it returns to shell. This is beacuse pty has two input pipes, one is for cygwin apps and the other one is for native windows apps. The key input during windows native program is runn

[PATCH 2/4] Cygwin: pty: Keep code page between non-cygwin apps.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 4) Code page cannot be changed by chcp.com. Acctually, chcp works itself and changes code page of its own pseudo console. However, since pseudo console is recreated for another process, it cannot inherit the code page. Th

[PATCH 3/4] Cygwin: pty: Make apps using console APIs be able to debug with gdb.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 2) The apps which use console API cannot be debugged with gdb. This is because pseudo console is not activated since gdb uses CreateProcess() rather than exec(). Even with this limitation, attaching gdb to native app, in whi

[PATCH 4/4] Cygwin: pty: Allow multiple apps to enable pseudo console simultaneously.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 7) Pseudo console cannot be activated if it is already activated for another process on same pty. This patch clears this disadvantage. --- winsup/cygwin/fhandler.h | 3 + winsup/cygwin/fhandler_tty.cc | 239 +

[PATCH v2 0/4] Improve pseudo console support.

2021-01-21 Thread Takashi Yano via Cygwin-patches
The new implementation of pseudo console support by commit bb428520 provides the important advantages, while there also has been several disadvantages compared to the previous implementation. These patches overturn some of them. The disadvantage: 1) The cygwin program which calls console API dir

[PATCH v2 1/4] Cygwin: pty: Inherit typeahead data between two input pipes.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- PTY has a problem that the key input, which is typed during windows native app is running, disappears when it returns to shell. This is beacuse pty has two input pipes, one is for cygwin apps and the other one is for native windows apps. The key input during windows native program is runn

[PATCH v2 2/4] Cygwin: pty: Keep code page between non-cygwin apps.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 4) Code page cannot be changed by chcp.com. Acctually, chcp works itself and changes code page of its own pseudo console. However, since pseudo console is recreated for another process, it cannot inherit the code page. Th

[PATCH v2 3/4] Cygwin: pty: Make apps using console APIs be able to debug with gdb.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 2) The apps which use console API cannot be debugged with gdb. This is because pseudo console is not activated since gdb uses CreateProcess() rather than exec(). Even with this limitation, attaching gdb to native app, in whi

[PATCH v2 4/4] Cygwin: pty: Allow multiple apps to enable pseudo console simultaneously.

2021-01-21 Thread Takashi Yano via Cygwin-patches
- After commit bb428520, there has been the disadvantage: 7) Pseudo console cannot be activated if it is already activated for another process on same pty. This patch clears this disadvantage. --- winsup/cygwin/fhandler.h | 3 + winsup/cygwin/fhandler_tty.cc | 240 +

Re: [PATCH] Cygwin: ptsname_r: always return an error number on failure

2021-01-21 Thread Ken Brown via Cygwin-patches
On 1/20/2021 1:00 PM, Ken Brown via Cygwin-patches wrote: Following Linux, return ENOTTY on a bad file descriptor and also set errno to ENOTTY. Previously 0 was returned and errno was set to EBADF. Returning 0 violates the requirement in https://man7.org/linux/man-pages/man3/ptsname_r.3.html th