Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Mar 2021 21:42:06 +0900 Takashi Yano wrote: > On Tue, 23 Mar 2021 21:32:12 +0900 > Takashi Yano wrote: > > I try to check run.exe behaviour and noticed that > > run cmd.exe > > and > > run cat.exe > > does not work with cygwin 3.0.7 and 3.2.0 (TEST) while these > > work in 3.1.7. > >

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Mar 2021 21:32:12 +0900 Takashi Yano wrote: > I try to check run.exe behaviour and noticed that > run cmd.exe > and > run cat.exe > does not work with cygwin 3.0.7 and 3.2.0 (TEST) while these > work in 3.1.7. In obove cases, cmd.exe and cat.exe is running in *hidden* console,

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Mar 2021 13:17:16 +0100 Corinna Vinschen wrote: > On Mar 23 20:57, Takashi Yano via Cygwin-patches wrote: > > Corinna Vinschen wrote: > > > > > On Mar 22 08:07, Takashi Yano via Cygwin-patches wrote: > > > > > > > And also,

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Mar 2021 11:10:04 +0100 Corinna Vinschen wrote: > [CC Marco, CC Jan] > > On Mar 22 13:02, Ken Brown via Cygwin-patches wrote: > > [Still CC Marco] > > > > On 3/22/2021 7:43 AM, Corinna Vinschen via Cygwin-patches wrote: > > > [CC Marco] > >

[PATCH] Cygwin: pty: Rename input/output named pipes.

2021-03-23 Thread Takashi Yano via Cygwin-patches
- Currently, names of output pipes are "pty%d-to-master" and "pty%d- to-master-cyg" and names of input pipes are "pty%d-to-slave" and "pty%d-from-master". With this patch, these pipes are renamed to "pty%d-to-master-nat", "pty%d-to-master", "pty%d-from-master-nat" and "pty%d-from-master"

Re: [PATCH] Cygwin: pty: Rename input named pipes.

2021-03-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Mar 2021 10:32:34 +0100 Corinna Vinschen wrote: > On Mar 23 09:38, Takashi Yano via Cygwin-patches wrote: > > On Mon, 22 Mar 2021 12:49:20 +0100 > > Corinna Vinschen wrote: > > > Hi Takashi, > > > > > > On Mar 21 12:59, Takashi Yano via

Re: [PATCH] Cygwin: pty: Rename input named pipes.

2021-03-22 Thread Takashi Yano via Cygwin-patches
On Mon, 22 Mar 2021 12:49:20 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Mar 21 12:59, Takashi Yano via Cygwin-patches wrote: > > - Currently, the name of input pipe is "pty-from-master" for > > cygwin process, and "pty-to-slave" for non

[PATCH v2 3/3] Cygwin: pty: Clear input_available_event if pipe is empty on close.

2021-03-21 Thread Takashi Yano via Cygwin-patches
- If apps read input from get_handle_cyg() directly by ReadFile(), input_available_event may remains signalled. This patch clears input_available_event if the pipe is empty on closing pty slave. --- winsup/cygwin/fhandler_tty.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH v2 2/3] Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle.

2021-03-21 Thread Takashi Yano via Cygwin-patches
- Currently, GetStdHandle(STD_INPUT_HANDLE) returns input handle for non-cygwin process. If cygwin process read from non-cygwin pipe, this causes hang up because master writes input to cygwin pipe. Also, setup_locale() is called to make charset conversion for output handle work properly.

[PATCH v2 1/3] Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle.

2021-03-21 Thread Takashi Yano via Cygwin-patches
- Currently, _get_osfhandle() returns input handle for pty even for stdout and stdout. This patch fixes the issue. Also, setup_locale() is called to make sure the charset conversion works for output. --- winsup/cygwin/syscalls.cc | 13 - 1 file changed, 12 insertions(+), 1

[PATCH v2 0/3] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-21 Thread Takashi Yano via Cygwin-patches
Takashi Yano (3): Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle. Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle. Cygwin: pty: Clear input_available_event if pipe is empty on close. winsup/cygwin/fhandler_tty.cc | 31

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-21 Thread Takashi Yano via Cygwin-patches
On Sun, 21 Mar 2021 17:44:27 +0900 Takashi Yano wrote: > On Sun, 21 Mar 2021 13:01:24 +0900 > Takashi Yano wrote: > > Takashi Yano (2): > > Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle. > > Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle. > > > >

Re: [PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-21 Thread Takashi Yano via Cygwin-patches
On Sun, 21 Mar 2021 13:01:24 +0900 Takashi Yano wrote: > Takashi Yano (2): > Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle. > Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle. > > winsup/cygwin/fhandler_tty.cc | 19 +++ >

[PATCH 2/2] Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle.

2021-03-20 Thread Takashi Yano via Cygwin-patches
- Currently, GetStdHandle(STD_INPUT_HANDLE) returns input handle for non-cygwin process. If cygwin process read from non-cygwin pipe, this causes hang up because master writes input to cygwin pipe. Also, setup_locale() is called to make charset conversion for output handle work properly.

[PATCH 1/2] Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle.

2021-03-20 Thread Takashi Yano via Cygwin-patches
- Currently, _get_osfhandle() returns input handle for pty even for stdout and stdout. This patch fixes the issue. Also, setup_locale() is called to make sure the charset conversion works for output. --- winsup/cygwin/syscalls.cc | 13 - 1 file changed, 12 insertions(+), 1

[PATCH 0/2] Return appropriate handle by _get_osfhandle() and GetStdHandle().

2021-03-20 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: syscalls.cc: Make _get_osfhandle() return appropriate handle. Cygwin: pty: Add hook for GetStdHandle() to return appropriate handle. winsup/cygwin/fhandler_tty.cc | 19 +++ winsup/cygwin/syscalls.cc | 13 - 2 files changed, 31

[PATCH] Cygwin: pty: Rename input named pipes.

2021-03-20 Thread Takashi Yano via Cygwin-patches
- Currently, the name of input pipe is "pty-from-master" for cygwin process, and "pty-to-slave" for non-cygwin process. These are not only inconsistent with output pipes but also very confusing. With this patch, these are renamed to "pty-from-master-cyg" and

[PATCH] Cygwin: pty: Transfer input only if the stdin is a pty.

2021-03-08 Thread Takashi Yano via Cygwin-patches
- The commit 12325677f73a did not fix enough. With this patch, more transfer_input() calls are skipped if stdin is redirected or piped. --- winsup/cygwin/fhandler_tty.cc | 10 -- winsup/cygwin/spawn.cc| 9 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git

Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.

2021-03-08 Thread Takashi Yano via Cygwin-patches
On Mon, 8 Mar 2021 21:52:37 +0100 Corinna Vinschen wrote: > On Mar 9 00:48, Takashi Yano via Cygwin-patches wrote: > > On Mon, 8 Mar 2021 16:32:16 +0100 > > Corinna Vinschen wrote: > > > Hi Takashi, > > > > > > On Mar 8 23:55, Takashi Yano via Cygwin-pa

Re: [PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.

2021-03-08 Thread Takashi Yano via Cygwin-patches
On Mon, 8 Mar 2021 16:32:16 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Mar 8 23:55, Takashi Yano via Cygwin-patches wrote: > > - Currently, transfer input is triggered even if the stdin of native > > app is not a pseudo console. With this patch it is triggered on

[PATCH] Cygwin: pty: Transfer input for native app only if the stdin is pcon.

2021-03-08 Thread Takashi Yano via Cygwin-patches
- Currently, transfer input is triggered even if the stdin of native app is not a pseudo console. With this patch it is triggered only if the stdin is a pseudo console. --- winsup/cygwin/fhandler_tty.cc | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH] Cygwin: pty: Attach to stub process when non-cygwin app inherits pcon.

2021-03-08 Thread Takashi Yano via Cygwin-patches
- If two non-cygwin apps are started simultaneously, attaching to pseudo console sometimes fails. This is because the second app trys to attach to the process not started yet. This patch avoids the issue by attaching to the stub process rather than the other non-cygwin app. ---

[PATCH] Cygwin: console, pty: Stop ignoring Ctrl-C by IGNBRK.

2021-03-06 Thread Takashi Yano via Cygwin-patches
- Perhaps current code misunderstand meaning of the IGNBRK. As far as I investigated, IGNBRK is concerned with break signal in serial port but there is no evidence that it has effect to ignore Ctrl-C. This patch stops ignoring Ctrl-C by IGNBRK for non-cygwin apps. ---

[PATCH] Cygwin: pty: Discard input already accepted on interrupt.

2021-03-05 Thread Takashi Yano via Cygwin-patches
- Currently, input already accepted is not discarded on interrupt by VINTR, VQUIT and VSUSP keys. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/fhandler_termios.cc | 5 - winsup/cygwin/fhandler_tty.cc | 23 +++

[PATCH v2] Cygwin: console: Fix restoring console mode failure.

2021-03-04 Thread Takashi Yano via Cygwin-patches
- Restoring console mode fails in the following scenario. 1) Start cygwin shell in command prompt. 2) Run 'exec chcp.com'. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/spawn.cc | 14 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff

Re: [PATCH] Cygwin: console: Fix restoring console mode failure.

2021-03-04 Thread Takashi Yano via Cygwin-patches
On Thu, 4 Mar 2021 17:57:34 +0900 Takashi Yano wrote: > - Restoring console mode fails in the following scenario. >1) Start cygwin shell in command prompt. >2) Run 'exec chcp.com'. > This patch fixes the issue. > --- > winsup/cygwin/fhandler.h | 1 + > winsup/cygwin/spawn.cc | 14

[PATCH] Cygwin: console: Fix restoring console mode failure.

2021-03-04 Thread Takashi Yano via Cygwin-patches
- Restoring console mode fails in the following scenario. 1) Start cygwin shell in command prompt. 2) Run 'exec chcp.com'. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/spawn.cc | 14 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff

[PATCH] Cygwin: pty: Fix a race issue in startup of pseudo console.

2021-03-04 Thread Takashi Yano via Cygwin-patches
- If two non-cygwin apps are started simultaneously and this is the first execution of non-cygwin apps in the pty, these occasionally hang up. The cause is the race issue between term_has_pcon_cap(), reset_switch_to_pcon() and setup_pseudoconsole(). This patch fixes the issue. ---

Re: [PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.

2021-02-23 Thread Takashi Yano via Cygwin-patches
On Tue, 23 Feb 2021 22:13:52 +0900 Takashi Yano wrote: > Hi Thomas, > > On Tue, 23 Feb 2021 12:24:09 +0100 > Thomas Wolff wrote: > > I've downloaded yesterday's snapshot (2021-02-22) for some testing. > > If I compile mintty (which passes without problem) and try to run it, it > > just exits

Re: [PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.

2021-02-23 Thread Takashi Yano via Cygwin-patches
Hi Thomas, On Tue, 23 Feb 2021 12:24:09 +0100 Thomas Wolff wrote: > I've downloaded yesterday's snapshot (2021-02-22) for some testing. > If I compile mintty (which passes without problem) and try to run it, it > just exits silently (no window popped up). > After reverting to 3.1.7, it runs just

[PATCH] Cygwin: console: Prevent NULL pointer access in close().

2021-02-22 Thread Takashi Yano via Cygwin-patches
- There seems to be a case that shared_console_info is not set yet when close() is called. This patch adds guard for such case. --- winsup/cygwin/fhandler_console.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_console.cc

Re: [PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.

2021-02-22 Thread Takashi Yano via Cygwin-patches
On Mon, 22 Feb 2021 20:41:00 +0900 Takashi Yano wrote: > On Mon, 22 Feb 2021 10:51:19 +0100 > Corinna Vinschen wrote: > > So, what do you think is the state of the console code, Takashi? > > Shall we start a release cycle next week? > > I think all the fixes and improvements that come to mind at

Re: [PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.

2021-02-22 Thread Takashi Yano via Cygwin-patches
On Mon, 22 Feb 2021 10:51:19 +0100 Corinna Vinschen wrote: > So, what do you think is the state of the console code, Takashi? > Shall we start a release cycle next week? I think all the fixes and improvements that come to mind at this point have been completed. As for releasing, I believe I've

[PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.

2021-02-20 Thread Takashi Yano via Cygwin-patches
- After commit 253352e796ff9ec9a447e5375f5bc3e2b92b5293, mc (midnight commander) crashes with segfault if the shell is bash. This is due to NULL pointer access in read(). This patch fixes the issue. Addresses:: https://cygwin.com/pipermail/cygwin/2021-February/247870.html ---

[PATCH 1/2] Cygwin: pty: Make FLUSHO and Ctrl-O work.

2021-02-19 Thread Takashi Yano via Cygwin-patches
- Previously, FLUSHO feature was implemented incompletely. With this patch, FLUSHO and Ctrl-O (VDISCARD) get working. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_tty.cc | 17 +++-- winsup/cygwin/select.cc | 5 + winsup/cygwin/tty.cc | 1 +

[PATCH 2/2] Cygwin: console: Add support for FLUSHO and Ctrl-O.

2021-02-19 Thread Takashi Yano via Cygwin-patches
- With this patch, FLUSHO and Ctrl-O (VDISCARD) get working. --- winsup/cygwin/fhandler_console.cc | 11 +++ 1 file changed, 11 insertions(+) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index ca8eb6400..6ded9eabf 100644 ---

[PATCH 0/2] Cygwin: pty, console: Make FLUSHO and Ctrl-O work.

2021-02-19 Thread Takashi Yano via Cygwin-patches
- With these patches, FLUSHO and Ctrl-O (VDISCARD) get working. Takashi Yano (2): Cygwin: pty: Make FLUSHO and Ctrl-O work. Cygwin: console: Add support for FLUSHO and Ctrl-O. winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_console.cc | 11 +++

[PATCH] Cygwin: pty: Make tty setting NOFLSH work.

2021-02-18 Thread Takashi Yano via Cygwin-patches
- With this patch, "stty noflsh" gets working in pty. --- winsup/cygwin/fhandler_termios.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index e8daf946b..ae35fe894 100644 ---

[PATCH] Cygwin: pty: Reflect tty settings to pseudo console mode.

2021-02-18 Thread Takashi Yano via Cygwin-patches
- With this patch, tty setting such as echo, icanon, isig and onlcr are reflected to pseudo console mode. --- winsup/cygwin/fhandler_tty.cc | 27 +++ 1 file changed, 27 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

[PATCH] Cygwin: Add console fix regarding Ctrl-Z etc. to release notes.

2021-02-18 Thread Takashi Yano via Cygwin-patches
--- winsup/cygwin/release/3.2.0 | 5 + 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/release/3.2.0 b/winsup/cygwin/release/3.2.0 index d02d16863..d69ed446c 100644 --- a/winsup/cygwin/release/3.2.0 +++ b/winsup/cygwin/release/3.2.0 @@ -9,6 +9,11 @@ What's new: thrd_detach,

[PATCH 2/2] Cygwin: console: Fix handling of Ctrl-S in Win7.

2021-02-18 Thread Takashi Yano via Cygwin-patches
- If ENABLE_LINE_INPUT is set, Ctrl-S is handled by Windows if the OS is Windows 7. This conflicts with Ctrl-S handling in cygwin console code. This patch unsets ENABLE_LINE_INPUT flag in cygwin and set it when native app is executed. --- winsup/cygwin/fhandler.h | 9 +-

[PATCH 0/2] Console fixes for Win7.

2021-02-18 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: console: Fix SIGWINCH handling in Win7. Cygwin: console: Fix handling of Ctrl-S in Win7. winsup/cygwin/fhandler.h | 9 +- winsup/cygwin/fhandler_console.cc | 306 -- winsup/cygwin/select.cc | 4 +-

[PATCH 1/2] Cygwin: console: Fix SIGWINCH handling in Win7.

2021-02-18 Thread Takashi Yano via Cygwin-patches
- If ENABLE_VIRTUAL_TERMINAL_INPUT is not set, changing window height does not generate WINDOW_BUFFER_SIZE_EVENT. This happens if console is in the legacy mode. Therefore, with this patch, the windows size is checked every time in cons_master_thread() if the cosole is in the legacy mode.

[PATCH v2] Cygwin: console: Introduce new thread which handles input signal.

2021-02-16 Thread Takashi Yano via Cygwin-patches
- Currently, Ctrl-Z, Ctrl-\ and SIGWINCH does not work in console if the process does not call read() or select(). This is because these are processed in process_input_message() which is called from read() or select(). This is a long standing issue of console. Addresses:

[PATCH] Cygwin: console: Introduce new thread which handles input signal.

2021-02-16 Thread Takashi Yano via Cygwin-patches
- Currently, Ctrl-Z, Ctrl-\ and SIGWINCH does not work in console if the process does not call read() or select(). This is because these are processed in process_input_message() which is called from read() or select(). This is a long standing issue of console. Addresses:

Re: [PATCH v2] Cygwin: console: Abort read() on signal if SA_RESTART is not set.

2021-02-15 Thread Takashi Yano via Cygwin-patches
On Mon, 15 Feb 2021 13:04:41 +0100 Corinna Vinschen wrote: > On Feb 14 18:42, Takashi Yano via Cygwin-patches wrote: > > - Currently, console read() keeps reading after SIGWINCH is sent > > even if SA_RESTART flag is not set. With this patch, read() > > returns EINTR on S

[PATCH] Cygwin: pty: Fix a bug in input transfer for GDB.

2021-02-14 Thread Takashi Yano via Cygwin-patches
- With this patch, not only NL but also CR is treated as a line end in the code checking if input transfer is necessary. --- winsup/cygwin/fhandler_tty.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

[PATCH v2] Cygwin: console: Abort read() on signal if SA_RESTART is not set.

2021-02-14 Thread Takashi Yano via Cygwin-patches
- Currently, console read() keeps reading after SIGWINCH is sent even if SA_RESTART flag is not set. With this patch, read() returns EINTR on SIGWINCH if SA_RESTART flag is not set. The same problem for SIGQUIT and SIGTSTP has also been fixed. --- winsup/cygwin/fhandler_console.cc | 7

[PATCH] Cygwin: console: Abort read() on SIGWINCH if SA_RESTART is not set.

2021-02-14 Thread Takashi Yano via Cygwin-patches
- Currently, console read() keeps reading after SIGWINCH is sent even if SA_RESTART flag is not set. With this patch, read() returns EINTR on SIGWINCH if SA_RESTART flag is not set. --- winsup/cygwin/fhandler_console.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2] Cygwin: pty: Reduce unecessary input transfer.

2021-02-11 Thread Takashi Yano via Cygwin-patches
- Currently, input transfer is performed every time one line is read(), if the non-cygwin app is running in the background. With this patch, transfer is triggered by setpgid() rather than read() so that the unnecessary input transfer can be reduced much in that situation. ---

Re: [PATCH] Cygwin: pty: Reduce unecessary input transfer.

2021-02-10 Thread Takashi Yano via Cygwin-patches
On Wed, 10 Feb 2021 18:02:59 +0900 Takashi Yano wrote: > - Currently, input transfer is performed every time one line is read(), > if the non-cygwin app is running in the background. With this patch, > transfer is triggered by setpgid() rather than read() so that the > unnecessary input

[PATCH] Cygwin: pty: Reduce unecessary input transfer.

2021-02-10 Thread Takashi Yano via Cygwin-patches
- Currently, input transfer is performed every time one line is read(), if the non-cygwin app is running in the background. With this patch, transfer is triggered by setpgid() rather than read() so that the unnecessary input transfer can be reduced much in that situation. ---

[PATCH] Cygwin: exceptions.cc: Suspend all threads in sig_handle_tty_stop().

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently, thread created by pthread_create() is not suspended by the signal SIGTSTP. For example, even if a process with a thread is suspended by Ctrl-Z, the thread continues running. This patch fixes the issue. --- winsup/cygwin/exceptions.cc | 2 ++ 1 file changed, 2 insertions(+)

[PATCH] Cygwin: console: Align the behaviour against signal with pty.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently, read() returns -1 with EINTR if the process is suspended by Ctrl-Z and resumed by fg command, while pty continues to read. For example, xxd command stops with error "Interrupted system call" after Ctrl-Z and fg. This patch aligns the behaviour with pty (and Linux). ---

[PATCH v3 2/2] Cygwin: pty: Make slave read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently slave read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 06fc19ac2..48b89ae77 100644 ---

[PATCH v3 1/2] Cygwin: console: Make read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 10 ++ winsup/cygwin/fhandler_console.cc | 11 ++- winsup/cygwin/fhandler_termios.cc | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git

[PATCH v3 0/2] Make terminal read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
Currently read() for console and pty slave are somehow not thread-safe. These patches fix the issue. Takashi Yano (2): Cygwin: console: Make read() thread-safe. Cygwin: pty: Make slave read() thread-safe. winsup/cygwin/fhandler.h | 10 ++ winsup/cygwin/fhandler_console.cc |

Re: [PATCH v2 1/2] Cygwin: console: Make read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
On Thu, 28 Jan 2021 21:20:09 +0900 Takashi Yano wrote: > - Currently read() is somehow not thread-safe. This patch fixes the > issue. > --- > winsup/cygwin/fhandler_console.cc | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) Sorry again. This also has a problem.. --

[PATCH v2 2/2] Cygwin: pty: Make slave read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently slave read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 06fc19ac2..48b89ae77 100644 ---

[PATCH v2 1/2] Cygwin: console: Make read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 02d0ac052..d0e5bb33a

[PATCH v2 0/2] Make terminal read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
Currently read() for console and pty slave are somehow not thread-safe. These patches fix the issue. Takashi Yano (2): Cygwin: console: Make read() thread-safe. Cygwin: pty: Make slave read() thread-safe. winsup/cygwin/fhandler_console.cc | 10 +- winsup/cygwin/fhandler_tty.cc |

Re: [PATCH 1/2] Cygwin: console: Make read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
On Thu, 28 Jan 2021 20:14:08 +0900 Takashi Yano wrote: > - Currently read() is somehow not thread-safe. This patch fixes the > issue. > --- > winsup/cygwin/fhandler_console.cc | 7 +++ > winsup/cygwin/select.cc | 3 --- > 2 files changed, 3 insertions(+), 7 deletions(-) Sorry,

[PATCH 2/2] Cygwin: pty: Make slave read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently slave read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 06fc19ac2..48b89ae77 100644 ---

[PATCH 1/2] Cygwin: console: Make read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
- Currently read() is somehow not thread-safe. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 7 +++ winsup/cygwin/select.cc | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc

[PATCH 0/2] Make terminal read() thread-safe.

2021-01-28 Thread Takashi Yano via Cygwin-patches
Currently read() for console and pty slave are somehow not thread-safe. These patches fix the issue. Takashi Yano (2): Cygwin: console: Make read() thread-safe. Cygwin: pty: Make slave read() thread-safe. winsup/cygwin/fhandler_console.cc | 7 +++ winsup/cygwin/fhandler_tty.cc | 6

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

2021-01-27 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 | 7 +- winsup/cygwin/fhandler_tty.cc | 344

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

2021-01-27 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

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

2021-01-27 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

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

2021-01-27 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

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

2021-01-26 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 | 7 +- winsup/cygwin/fhandler_tty.cc | 344

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

2021-01-26 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

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

2021-01-26 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.

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

2021-01-26 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

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

2021-01-26 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

Re: [PATCH v5 0/4] Improve pseudo console support.

2021-01-26 Thread Takashi Yano via Cygwin-patches
On Tue, 26 Jan 2021 12:52:25 +0900 Takashi Yano wrote: > 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. >

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

2021-01-25 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 | 7 +- winsup/cygwin/fhandler_tty.cc | 346

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

2021-01-25 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

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

2021-01-25 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.

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

2021-01-25 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

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

2021-01-25 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

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

2021-01-25 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 | 7 +- winsup/cygwin/fhandler_tty.cc | 346

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

2021-01-25 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

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

2021-01-25 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.

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

2021-01-25 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

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

2021-01-25 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

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

2021-01-25 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 | 7 +- winsup/cygwin/fhandler_tty.cc | 342

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

2021-01-25 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

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

2021-01-25 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.

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

2021-01-25 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

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

2021-01-25 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

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

2021-01-25 Thread Takashi Yano via Cygwin-patches
Hi Corinna, Thanks for testing. On Fri, 22 Jan 2021 13:20:57 +0100 Corinna Vinschen wrote: > Hi Takashi, > > On Jan 22 05:58, Takashi Yano via Cygwin-patches wrote: > > The new implementation of pseudo console support by commit bb428520 > > provides the important advanta

[PATCH] Cygwin: console: Add missing guard regarding attach_mutex.

2021-01-25 Thread Takashi Yano via Cygwin-patches
- The commit a545 did not fix the problem enough. This patch provides additional guard for the issue. --- winsup/cygwin/fhandler_console.cc | 27 +++ 1 file changed, 27 insertions(+) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc

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

2021-01-22 Thread Takashi Yano via Cygwin-patches
On Fri, 22 Jan 2021 10:50:28 +0100 Corinna Vinschen wrote: > On Jan 22 05:58, Takashi Yano via Cygwin-patches wrote: > > The new implementation of pseudo console support by commit bb428520 > > provides the important advantages, while there also has been several > > d

[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

[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.

[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

[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

[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 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

[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.

  1   2   3   >