[PATCH] Cygwin: console: Make cursor keys work in vim under ConEmu.

2020-05-30 Thread Takashi Yano via Cygwin-patches
- After commit 774b8996d1f3e535e8267be4eb8e751d756c2cec, cursor keys do not work in vim under ConEmu without cygwin-connector. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_console.cc | 20 ++-- 2 files changed, 15

[PATCH 2/4] Cygwin: console: Discard some unsupported escape sequences.

2020-05-30 Thread Takashi Yano via Cygwin-patches
- If the cygwin vim is started from a non-cygwin process which is executed in pseudo console, shift key and ctrl key do not work. In this case, vim is executed under /dev/cons*. If vim outputs escape sequence which is not supported by pseudo console, the escape sequence is leaked into the

[PATCH 4/4] Cygwin: pty: Revise the code which prevents undesired window title.

2020-05-30 Thread Takashi Yano via Cygwin-patches
- In current pty, the window title can not be set from non-cygwin program due to the code which prevents overwriting the window title to "cygwin-console-helper.exe" in fhandler_pty_master::pty_ master_fwd_thread(). This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 9 +++--

[PATCH 3/4] Cygwin: pty: Clean up fhandler_pty_master::pty_master_fwd_thread().

2020-05-30 Thread Takashi Yano via Cygwin-patches
- Remove the code which is not necessary anymore. --- winsup/cygwin/fhandler_tty.cc | 18 -- 1 file changed, 18 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index d017cde38..c3d49968d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++

[PATCH 1/4] Cygwin: pty: Prevent garbage remained in read ahead buffer.

2020-05-30 Thread Takashi Yano via Cygwin-patches
- After commit 29431fcb5b14d4c5ac3b3161a076eb1a208349d9, the issue reported in https://cygwin.com/pipermail/cygwin/2020-May/245057.html occurs. This is caused by the following mechanism. Cygwin less called from non-cygwin git is executed under /dev/cons* rather than /dev/pty* because

[PATCH 0/4] Some fixes for pty.

2020-05-30 Thread Takashi Yano via Cygwin-patches
Patches for https://cygwin.com/pipermail/cygwin/2020-May/245057.html and three other issues that were noticed during this fix. Takashi Yano (4): Cygwin: pty: Prevent garbage remained in read ahead buffer. Cygwin: console: Discard some unsupported escape sequences. Cygwin: pty: Clean up

[PATCH] Cygwin: pty: Fix screen distortion after using less for native apps.

2020-06-01 Thread Takashi Yano via Cygwin-patches
- If the output of non-cygwin apps is browsed using less, screen is ocasionally distorted after less exits. This frequently happens if cmd.exe is executed after less. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 19 +++ 1 file changed, 11 insertions(+), 8

Re: [PATCH] Cygwin: pty: Fix screen distortion after using less for native apps.

2020-06-01 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Mon, 1 Jun 2020 15:16:18 +0900 Takashi Yano wrote: > - If the output of non-cygwin apps is browsed using less, screen is > ocasionally distorted after less exits. This frequently happens > if cmd.exe is executed after less. This patch fixes the issue. I have

Re: [PATCH] Cygwin: pty: Make system_printf() work after closing pty slave.

2020-05-20 Thread Takashi Yano via Cygwin-patches
On Tue, 19 May 2020 15:04:24 -0400 Ken Brown via Cygwin-patches wrote: > Hi Takashi, > > On 5/19/2020 7:35 AM, Takashi Yano via Cygwin-patches wrote: > > - Current pty cannot show system_printf() output after closing pty > >slave. This patch fixes the issue. >

[PATCH] Cygwin: pty: Fix screen distortion after less for native apps again.

2020-06-02 Thread Takashi Yano via Cygwin-patches
- Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not enough. Fixed again. --- winsup/cygwin/fhandler_tty.cc | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

[PATCH] Cygwin: pty: Fix race condition in initialization of pseudo console.

2020-10-26 Thread Takashi Yano via Cygwin-patches
- If output of non-cygwin process is piped to cygwin process, such as less, the non-cygwin process sometimes fails to start and hangs. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 9 - 1 file changed, 9 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH] Cygwin: pty: Disable ResizePseudoConsole() if stdout is redirected.

2020-10-27 Thread Takashi Yano via Cygwin-patches
- Calling ResizePseudoConsole() generates some escape sequences. Due to this behaviour, if the output of non-cygwin app is piped to less, screen is sometimes distorted when the screen is resized. With this patch, ResizePseudoConsole() is not called if stdout is redirected. ---

[PATCH] Cygwin: pty: Change the timing of setup_locale() call.

2020-08-12 Thread Takashi Yano via Cygwin-patches
- If native app is exec()'ed in a new pty, setup_locale() loses the chance to be called. For example, with "mintty -e cmd", charset conversion does not work as expected. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH] Cygwin: pty: Discard CSI > Pm m sequence from native windows apps.

2020-06-30 Thread Takashi Yano via Cygwin-patches
- If vim is started from WSL (Ubuntu) which is executed in pseudo console in mintty, shift key and ctrl key do not work. Though this issue is similar to the issue resolved by commit 4527541ec66af8d82bb9dba5d25afdf489d71271, that commit is not effective for this issue. This patch fixes the

[PATCH] Cygwin: pty, termios: Unify thoughts of read ahead beffer handling.

2020-06-30 Thread Takashi Yano via Cygwin-patches
- Return value of eat_readahead() is redefined. The return values of fhandler_termios::eat_readahead() and fhandler_pty_slave:: eat_readahead() were little bit different. This patch unifies them to number of bytes eaten by eat_readahead(). - Considerration for raixget() is added to

[PATCH v2] Cygwin: pty: Fix screen distortion after less for native apps again.

2020-06-03 Thread Takashi Yano via Cygwin-patches
- Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not enough. Moreover, it does not work as expected at all in Win10 1809. This patch essentially reverts that commit and add another fix. After all, the cause of the problem was a race issue in switch_to_pcon_out flag. That is,

Re: [PATCH v2] Cygwin: pty: Fix screen distortion after less for native apps again.

2020-06-03 Thread Takashi Yano via Cygwin-patches
On Wed, 3 Jun 2020 18:45:11 +0900 Takashi Yano wrote: > - Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not > enough. Moreover, it does not work as expected at all in Win10 > 1809. This patch essentially reverts that commit and add another > fix. After al

[PATCH v3] Cygwin: pty: Fix screen distortion after less for native apps again.

2020-06-03 Thread Takashi Yano via Cygwin-patches
- Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not enough. Moreover, it does not work as expected at all in Win10 1809. This patch essentially reverts that commit and add another fix. After all, the cause of the problem was a race issue in switch_to_pcon_out flag. That is,

Re: [PATCH] Cygwin: pty: Fix screen distortion after less for native apps again.

2020-06-03 Thread Takashi Yano via Cygwin-patches
On Tue, 2 Jun 2020 21:44:40 +0900 Takashi Yano wrote: > - Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not > enough. Fixed again. This patch does not work as expected in Win10 1809. I will submit v2 patch which is more essential shortly. -- Takashi Yano

[PATCH] Cygwin: pty: Fix a bug on redirecting something to /dev/pty*.

2020-07-17 Thread Takashi Yano via Cygwin-patches
- After commit 0365031ce1347600d854a23f30f1355745a1765c, key input becomes not working by following steps. 1) Start cmd.exe in mintty. 2) Open another mintty. 3) Execute "echo AAA > /dev/pty*" (pty* is the pty opened in 1.) This patch fixes the issue. ---

Re: [PATCH 5/5] Cygwin: Use MEMORY_WORKING_SET_EX_INFORMATION in dumper

2020-07-27 Thread Takashi Yano via Cygwin-patches
mper.cc @@ -272,7 +272,7 @@ typedef enum _MEMORY_INFORMATION_CLASS } MEMORY_INFORMATION_CLASS; extern "C" -NTSTATUS +NTSTATUS NTAPI NtQueryVirtualMemory(HANDLE ProcessHandle, LPVOID BaseAddress, MEMORY_INFORMATION_CLASS MemoryInformationClass, -- Takashi Yano

[PATCH] Cygwin: pty: Check response for CSI6n more strictly.

2020-12-16 Thread Takashi Yano via Cygwin-patches
- Previous code to read response for CSI6n allows invalid response such as "CSI Pl; Pc H" other than correct response "CSI Pl; Pc R". With this patch, the response is checked more strictly. --- winsup/cygwin/fhandler_tty.cc | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[PATCH] Cygwin: pty: Revise the workaround for rlwrap.

2020-12-16 Thread Takashi Yano via Cygwin-patches
- Previous workaround has a problem that screen is distorted if up arrow key is pressed at the first line after running "rlwrap cmd". This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 1/2] Cygwin: pty: Fix a bug in the code removing "CSI > Pm m".

2020-11-22 Thread Takashi Yano via Cygwin-patches
- The code added by 8121b606e843c001d5ca5213d24099e04ebc62ca has a bug which fails to remove multiple "CSI > Pm m" sequences. This patch fixes the bug. --- winsup/cygwin/fhandler_tty.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH 0/2] Two pty fixes regarding pseudo console.

2020-11-22 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: pty: Fix a bug in the code removing "CSI > Pm m". Cygwin: pty: Discard "OSC Ps;? BEL/ST" in pseudo console output. winsup/cygwin/fhandler_tty.cc | 31 +++ 1 file changed, 31 insertions(+) -- 2.29.2

[PATCH 2/2] Cygwin: pty: Discard "OSC Ps; ? BEL/ST" in pseudo console output.

2020-11-22 Thread Takashi Yano via Cygwin-patches
- If vim is executed in WSL in mintty, some garbage string caused by "OSC Ps;? BEL/ST" will be shown in some situations. This patch fixes the issue by removing "OSC Ps;? BEL/ST" from pseudo console output. --- winsup/cygwin/fhandler_tty.cc | 30 ++ 1 file

Re: [PATCH 2/2] Cygwin: pty: Discard "OSC Ps; ? BEL/ST" in pseudo console output.

2020-11-23 Thread Takashi Yano via Cygwin-patches
On Mon, 23 Nov 2020 09:58:59 +0100 Corinna Vinschen wrote: > Hi Takashi, > > just a small style nit: > > On Nov 23 14:28, Takashi Yano via Cygwin-patches wrote: > > - If vim is executed in WSL in mintty, some garbage string caused > > by "OSC Ps;? BEL/ST&q

[PATCH v2 2/3] Cygwin: pty: Discard "OSC Ps; ? BEL/ST" in pseudo console output.

2020-11-23 Thread Takashi Yano via Cygwin-patches
- If vim is executed in WSL in mintty, some garbage string caused by "OSC Ps;? BEL/ST" will be shown in some situations. This patch fixes the issue by removing "OSC Ps;? BEL/ST" from pseudo console output. --- winsup/cygwin/fhandler_tty.cc | 30 ++ 1 file

[PATCH v2 3/3] Cygwin: pty: Fix minor style issue.

2020-11-23 Thread Takashi Yano via Cygwin-patches
--- winsup/cygwin/fhandler_tty.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 3d58cc7df..422d7349d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -2043,7 +2043,7 @@

[PATCH v2 1/3] Cygwin: pty: Fix a bug in the code removing "CSI > Pm m".

2020-11-23 Thread Takashi Yano via Cygwin-patches
- The code added by 8121b606e843c001d5ca5213d24099e04ebc62ca has a bug which fails to remove multiple "CSI > Pm m" sequences. This patch fixes the bug. --- winsup/cygwin/fhandler_tty.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH v2 0/3] Three pty fixes regarding pseudo console.

2020-11-23 Thread Takashi Yano via Cygwin-patches
Takashi Yano (3): Cygwin: pty: Fix a bug in the code removing "CSI > Pm m". Cygwin: pty: Discard "OSC Ps;? BEL/ST" in pseudo console output. Cygwin: pty: Fix minor style issue. winsup/cygwin/fhandler_tty.cc | 33 - 1 file chang

[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

[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 0/4] Improve pseudo console support.

2021-01-21 Thread Takashi Yano via Cygwin-patches
directly does not work. is supposed to be able to be overcome as well, however, I am not sure it is worth enough. This will need a lot of hooks for console APIs. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep code page between non-cygwin apps

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

[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 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 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 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
lso been fixed. v4: Change the conditions for calling transfer_input() slightly in reset_switch_to_pcon() to avoid calling it if uncecessary or with no effect. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep code page between non-cygwin a

[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 v5 0/4] Improve pseudo console support.

2021-01-25 Thread Takashi Yano via Cygwin-patches
lso been fixed. v4: Change the conditions for calling transfer_input() slightly in reset_switch_to_pcon() to avoid calling it if uncecessary or with no effect. v5: Small bug fix in v4. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep c

[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

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 overtu

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

2021-01-21 Thread Takashi Yano via Cygwin-patches
directly does not work. is supposed to be able to be overcome as well, however, I am not sure it is worth enough. This will need a lot of hooks for console APIs. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep code page between non-cygwin apps

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

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 v3] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

[PATCH] Cygwin: spawn.cc: Fix typo in comment by commit 974e6d76.

2021-01-18 Thread Takashi Yano via Cygwin-patches
--- winsup/cygwin/spawn.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 42044ab53..d03492ee6 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -636,7 +636,7 @@ child_info_spawn::worker (const char

[PATCH] Cygwin: pty: Reduce buffer size in get_console_process_id().

2021-01-19 Thread Takashi Yano via Cygwin-patches
- The buffer used in get_console_process_id(), introduced by commit 72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7. Therefore, the buffer size has been reduced. --- winsup/cygwin/fhandler_tty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] Cygwin: pty: Reduce buffer size in get_console_process_id().

2021-01-20 Thread Takashi Yano via Cygwin-patches
On Wed, 20 Jan 2021 10:50:24 +0100 Corinna Vinschen wrote: > On Jan 20 09:57, Takashi Yano via Cygwin-patches wrote: > > - The buffer used in get_console_process_id(), introduced by commit > > 72770148, is too large and ERROR_NOT_ENOUGH_MEMORY occurs in Win7. > > Huh,

[PATCH] Cygwin: console: Fix "Bad file descriptor" error in script command.

2021-01-20 Thread Takashi Yano via Cygwin-patches
- After the commit 72770148, script command exits occasionally with the error "Bad file descriptor" if it is started in console on Win7 and non-cygwin process is executed. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 10 ++-- winsup/cygwin/select.cc | 95

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 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 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 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 0/4] Improve pseudo console support.

2021-01-25 Thread Takashi Yano via Cygwin-patches
lso been fixed. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep code page between non-cygwin apps. Cygwin: pty: Make apps using console APIs be able to debug with gdb. Cygwin: pty: Allow multiple apps to enable pseudo console simultaneou

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

[PATCH] Cygwin: pty: Lessen the side effect of workaround for rlwarp.

2021-01-19 Thread Takashi Yano via Cygwin-patches
- This patch lessens the side effect of the workaround for rlwrap introduced by commit 4e16b033. --- winsup/cygwin/fhandler_tty.cc | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

Re: [PATCH 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Mon, 18 Jan 2021 11:23:40 +0100 Corinna Vinschen wrote: > I'm going to push patches 1 - 3. In terms of patch 4 I have a few > questions: > > On Jan 15 17:32, Takashi Yano via Cygwin-patches wrote: > > @@ -2185,7 +2185,7 @@ private: > >bool send_win

[PATCH v2 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-18 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

Re: [PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-18 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 15 Jan 2021 18:26:31 +0900 Takashi Yano wrote: > - cat exits immediately in the following senario. > 1) Execute env CYGWIN=disable_pcon script > 2) Execute cmd.exe > 3) Execute cat in cmd.exe. > This is caused by setting input_available_eve

Re: [PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-18 Thread Takashi Yano via Cygwin-patches
On Mon, 18 Jan 2021 16:27:00 +0100 Corinna Vinschen wrote: > On Jan 19 00:00, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Fri, 15 Jan 2021 18:26:31 +0900 > > Takashi Yano wrote: > > > - cat exits immediately in the following sena

[PATCH 0/5] Some revisions for pty and console code.

2021-01-15 Thread Takashi Yano via Cygwin-patches
Takashi Yano (5): Cygwin: pty: Add workaround for rlwrap 0.40 or later. Cygwin: console: Revise the code to switch xterm mode. Cygwin: pty: Make close_pseudoconsole() be a static member function. Cygwin: pty: Prevent pty from changing code page of parent console. Cygwin: pty: Make master

[PATCH 1/5] Cygwin: pty: Add workaround for rlwrap 0.40 or later.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The workaround for rlwrap introduced by commit 8199b0cc does not take effect for rlwrap 0.40 or later. This patch add a workaround for rlwrap 0.40 or later as well. --- winsup/cygwin/fhandler_tty.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH 2/5] Cygwin: console: Revise the code to switch xterm mode.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- If application changes the console mode, mode management introduced by commit 10d8c278 will be corrupted. For example, stdout of jansi v2.0.1 or later is piped to less, jansi resets the xterm mode flag ENABLE_VIRTUAL_TERMINA_PROCESSING when jansi is terminated. This causes garbled output

[PATCH 3/5] Cygwin: pty: Make close_pseudoconsole() be a static member function.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The function close_pseudoconsole() should be static so that it can be safely called in spawn.cc even after the fhandler_pty_slave instance has been deleted. That is, there is a problem with the current code. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 3 ++-

[PATCH 4/5] Cygwin: pty: Prevent pty from changing code page of parent console.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- After commit 232fde0e, pty changes console code page when the first non-cygwin app is executed. If pty is started in real console device, pty changes the code page of root console. This causes very annoying result because changing code page changes the font of command prompt if console

[PATCH 5/5] Cygwin: pty: Make master thread functions be static.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- The functions pty_master_thread() and pty_master_fwd_thread() should be static (i.e. should not access class member) because the instance is deleted if the master is dup()'ed and the first master is closed. In this case, because the dup()'ed instance still exists, these master threads

[PATCH] Cygwin: pty: Set input_available_event only for cygwin pipe.

2021-01-15 Thread Takashi Yano via Cygwin-patches
- cat exits immediately in the following senario. 1) Execute env CYGWIN=disable_pcon script 2) Execute cmd.exe 3) Execute cat in cmd.exe. This is caused by setting input_available_event for the pipe for non-cygwin app. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc

[PATCH] Cygwin: pty: Revise the code for timeout in term_has_pcon_cap().

2020-12-14 Thread Takashi Yano via Cygwin-patches
- Sometimes timeout period in term_has_pcon_cap() may not be enough when the machine slows down for some reason. This patch eases the issue. In the new code, effective timeout period is expected to be extended as a result due to slowing-down the wait loop as well when the machine gets into

[PATCH] Cygwin: pty: Skip term_has_pcon_cap() if pseudo console is disabled.

2020-12-14 Thread Takashi Yano via Cygwin-patches
- This patch skips unnecessary term_has_pcon_cap() call if pseudo console is disabled. --- winsup/cygwin/fhandler_tty.cc | 2 -- winsup/cygwin/spawn.cc| 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc

[PATCH] Cygwin: pty: Add a workaround for rlwrap.

2020-12-14 Thread Takashi Yano via Cygwin-patches
- If rlwrap is used with non-cygwin apps, it fails to setup pseudo console. This patch adds a workaround for this issue. --- winsup/cygwin/fhandler_tty.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

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

2021-01-26 Thread Takashi Yano via Cygwin-patches
ing as a service (such as ssh session). Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pipes. Cygwin: pty: Keep code page between non-cygwin apps. Cygwin: pty: Make apps using console APIs be able to debug with gdb. Cygwin: pty: Allow multiple apps to enable pse

[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 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 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 v7 0/4] Improve pseudo console support.

2021-01-27 Thread Takashi Yano via Cygwin-patches
ing as a service (such as ssh session). v7: Specify FILE_FLAG_OVERLAPPED for to_slave pipe to prevent PeekNamedPipe() from blocking in transfer_input(). Simplify the code determining if the slave is reading. Takashi Yano (4): Cygwin: pty: Inherit typeahead data between two input pi

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

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

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

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

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

<    3   4   5   6   7   8   9   >