[PATCH] Cygwin: pty: Add FreeConsole to destructor of pty slave.

2020-03-12 Thread Takashi Yano via Cygwin-patches
- When pseudo console is closed, all the processes attched to the pseudo console are terminated. This causes the problem reported in https://sourceware.org/pipermail/cygwin/2020-March/244046.html. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 11 +-- 1 file changed,

Re: [PATCH] Cygwin: pty: Add FreeConsole to destructor of pty slave.

2020-03-15 Thread Takashi Yano via Cygwin-patches
On Fri, 13 Mar 2020 10:58:25 +0100 Corinna Vinschen wrote: > Pushed. However, the comment in that snippet (Why comes...) puzzles > me a bit. Can you clarify this a bit? _tc is set in fhandler_pty_master::setup() in very early stage. So I thought it should have valid value in destructor of pty sl

[PATCH] Cygwin: pty: Call FreeConsole() only if attached to current pty.

2020-05-16 Thread Takashi Yano via Cygwin-patches
- After commit 071b8e0cbd4be33449c12bb0d58f514ed8ef893c, the problem reported in https://cygwin.com/pipermail/cygwin/2020-May/244873.html occurs. This is due to freeing console device accidentally rather than pseudo console. This patch makes sure to call FreeConsole() only if the process is

[PATCH] Cygwin: termios: Set ECHOE, ECHOK, ECHOCTL and ECHOKE by default.

2020-05-16 Thread Takashi Yano via Cygwin-patches
- Backspace key does not work correctly in linux session opend by ssh from cygwin console if the shell is bash. This is due to lack of these flags. Addresses: https://cygwin.com/pipermail/cygwin/2020-May/244837.html. --- winsup/cygwin/fhandler_termios.cc | 3 ++- 1 file changed, 2 insertion

Re: [PATCH] Cygwin: termios: Set ECHOE, ECHOK, ECHOCTL and ECHOKE by default.

2020-05-17 Thread Takashi Yano via Cygwin-patches
On Mon, 18 May 2020 01:21:07 +0200 Kacper Michajlow via Cygwin-patches wrote: > On Sun, 17 May 2020 at 04:53, Takashi Yano via Cygwin-patches < > cygwin-patches@cygwin.com> wrote: > > > - Backspace key does not work correctly in linux session opend by > > ssh from

Re: [PATCH 00/21] FIFO: Support multiple readers

2020-05-17 Thread Takashi Yano via Cygwin-patches
On Thu, 7 May 2020 16:21:03 -0400 Ken Brown via Cygwin-patches wrote: > This project began as a an attempt to allow a FIFO to be opened > multiple times for reading. The initial motivation was that Midnight > Commander running under tcsh does this (unsuccessfully on Cygwin). > See > >https:

Re: [PATCH 00/21] FIFO: Support multiple readers

2020-05-17 Thread Takashi Yano via Cygwin-patches
On Mon, 18 May 2020 14:25:19 +0900 Takashi Yano via Cygwin-patches wrote: > However, mc hangs by several operations. > > To reproduce this: > 1. Start mc with 'env SHELL=tcsh mc -a' I mean 'env SHELL=/bin/tcsh mc -a' > 2. Select a file using up/down cu

Re: [PATCH 00/21] FIFO: Support multiple readers

2020-05-18 Thread Takashi Yano via Cygwin-patches
Hi Ken, On Mon, 18 May 2020 13:42:19 -0400 Ken Brown via Cygwin-patches wrote: > Hi Takashi, > > On 5/18/2020 12:03 PM, Ken Brown via Cygwin-patches wrote: > > On 5/18/2020 1:36 AM, Takashi Yano via Cygwin-patches wrote: > >> On Mon, 18 May 2020 14:25:19 +0900 >

Re: [PATCH 00/21] FIFO: Support multiple readers

2020-05-18 Thread Takashi Yano via Cygwin-patches
On Tue, 19 May 2020 10:26:09 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Ken, > > On Mon, 18 May 2020 13:42:19 -0400 > Ken Brown via Cygwin-patches wrote: > > Hi Takashi, > > > > On 5/18/2020 12:03 PM, Ken Brown via Cygwin-patches wrote: > > >

[PATCH v2] Cygwin: pty: Call FreeConsole() only if attached to current pty.

2020-05-19 Thread Takashi Yano via Cygwin-patches
- After commit 071b8e0cbd4be33449c12bb0d58f514ed8ef893c, the problem reported in https://cygwin.com/pipermail/cygwin/2020-May/244873.html occurs. This is due to freeing console device accidentally rather than pseudo console. This patch makes sure to call FreeConsole() only if the process is

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

2020-05-19 Thread Takashi Yano via Cygwin-patches
- Current pty cannot show system_printf() output after closing pty slave. This patch fixes the 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 5a1bcd3ce..02b78cd2c 100644 --- a/w

Re: [PATCH 00/21] FIFO: Support multiple readers

2020-05-19 Thread Takashi Yano via Cygwin-patches
On Tue, 19 May 2020 09:37:17 -0400 Ken Brown via Cygwin-patches wrote: > On 5/19/2020 8:51 AM, Ken Brown via Cygwin-patches wrote: > > On 5/19/2020 2:15 AM, Takashi Yano via Cygwin-patches wrote: > >> On Tue, 19 May 2020 10:26:09 +0900 > >> Takashi Yano via Cygwin-p

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

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

2020-05-21 Thread Takashi Yano via Cygwin-patches
On Wed, 20 May 2020 17:46:11 +0900 Takashi Yano via Cygwin-patches wrote: > 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

[PATCH] Cygwin: pty: Revise code to make system_printf() work after close.

2020-05-21 Thread Takashi Yano via Cygwin-patches
- After commit 0365031ce1347600d854a23f30f1355745a1765c, the issue https://cygwin.com/pipermail/cygwin-patches/2020q2/010259.html occurs. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 15 --- winsup/cygwin/tty.cc | 23 +++ winsup/cygwi

[PATCH] Cygwin: pty: Stop counting number of slaves attached to pseudo console.

2020-05-25 Thread Takashi Yano via Cygwin-patches
- The number of slaves attached to pseudo console is used only for triggering redraw screen. Counting was not only needless, but also did not work as expected. This patch removes the code for counting. --- winsup/cygwin/fhandler_tty.cc | 22 +- winsup/cygwin/tty.cc

[PATCH] Cygwin: pty: Fix a bug in free_attached_console().

2020-05-27 Thread Takashi Yano via Cygwin-patches
- After commit 7659ff0f5afd751f42485f2684c799c5f37b0fb9, nohup does not work as expected. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin-developers/2020-May/011885.html --- winsup/cygwin/fhandler_tty.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) d

[PATCH] Cygwin: pty: Prevent meaningless ResizePseudoConsole() calls.

2020-05-28 Thread Takashi Yano via Cygwin-patches
- This patch prevents to call ResizePseudoConsole() unless the pty is resized. --- winsup/cygwin/fhandler_tty.cc | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index f29a2c214..b091765b3 100644

[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 insertions(+

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

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

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

[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 +++ b/winsu

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

2020-05-31 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 del

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

2020-05-31 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 submitted this pa

[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 bcc7648f3..742fa7e

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 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, th

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 all, the cause of the pro

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

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

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

[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. --- winsup/cygwin/fhandler_tty.cc

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

2020-07-27 Thread Takashi Yano via Cygwin-patches
Hi Jon, On Sat, 18 Jul 2020 16:00:28 +0100 Jon Turney wrote: > Use the (undocumented) MEMORY_WORKING_SET_EX_INFORMATION in dumper to > determine if a MEM_IMAGE region is unsharable, and hence has been > modified. > --- > winsup/doc/utils.xml | 8 ++--- > winsup/utils/Makefile.in | 2 +- > w

[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: Change the timing of set_locale() call again.

2020-08-14 Thread Takashi Yano via Cygwin-patches
- After commit 095972ce5b1d319915501a7e381802914bed790c, charset conversion in mintty is broken if charset is set to other than UTF-8. This seems to be caused because mintty does not set locale yet at fork() call. This patch changes the timing of set_locale() call again to avoid this issue.

[PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-26 Thread Takashi Yano via Cygwin-patches
Pseudo console generates escape sequences on execution of non-cygwin apps. If the terminal does not support escape sequence, output will be garbled. This patch prevents garbled output in dumb terminal by disabling pseudo console. --- winsup/cygwin/spawn.cc | 36 +--

Re: [Patch] Fix incorrect code page when setting console title on Win10

2020-08-26 Thread Takashi Yano via Cygwin-patches
On Wed, 26 Aug 2020 19:33:45 +0200 Corinna Vinschen wrote: > On Aug 26 09:30, Johannes Schindelin wrote: > > Hi Corinna, > > > > On Wed, 26 Aug 2020, Corinna Vinschen wrote: > > > > > On Aug 26 16:43, 宫大汉 via Cygwin-patches wrote: > > > > When Cygwin sets console titles on Win10 (has_con_24bit_co

[PATCH] Cygwin: console: Replace WriteConsoleA() with WriteConsoleW().

2020-08-26 Thread Takashi Yano via Cygwin-patches
- To allow sending non-ASCII chars to console, all WriteConsoleA() are replaced by WriteConsoleW(). Addresses: https://cygwin.com/pipermail/cygwin-patches/2020q3/010476.html --- winsup/cygwin/fhandler_console.cc | 89 --- 1 file changed, 47 insertions(+), 42 delet

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-26 Thread Takashi Yano via Cygwin-patches
On Wed, 26 Aug 2020 19:36:06 +0200 Corinna Vinschen wrote: > On Aug 26 21:00, Takashi Yano via Cygwin-patches wrote: > > Pseudo console generates escape sequences on execution of non-cygwin > > apps. If the terminal does not support escape sequence, output will > > be garbled

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-27 Thread Takashi Yano via Cygwin-patches
On Thu, 27 Aug 2020 10:47:56 +0200 Corinna Vinschen wrote: > On Aug 27 13:07, Takashi Yano via Cygwin-patches wrote: > > On Wed, 26 Aug 2020 19:36:06 +0200 > > Corinna Vinschen wrote: > > > On Aug 26 21:00, Takashi Yano via Cygwin-patches wrote: > > > > Pseudo c

[PATCH] Cygwin: select: Fix a bug on closing pi->bye event.

2020-08-27 Thread Takashi Yano via Cygwin-patches
- Close event handle pi->bye only if it was created. Addresses: https://cygwin.com/pipermail/cygwin-developers/2020-August/011948.html --- winsup/cygwin/select.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 9

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-28 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 28 Aug 2020 15:45:03 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Aug 26 21:00, Takashi Yano via Cygwin-patches wrote: > > Pseudo console generates escape sequences on execution of non-cygwin > > apps. If the terminal does not support escape

[PATCH v2] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-28 Thread Takashi Yano via Cygwin-patches
- Pseudo console internally sends escape sequence CSI6n (query cursor position) on startup of non-cygwin apps. If the terminal does not support CSI6n, CreateProcess() hangs waiting for response. This patch prevents hang in dumb terminal by disabling pseudo console. --- winsup/cygwin/fhandler

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-29 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Sat, 29 Aug 2020 04:25:54 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Fri, 28 Aug 2020 15:45:03 +0200 > Corinna Vinschen wrote: > > Hi Takashi, > > > > On Aug 26 21:00, Takashi Yano via Cygwin-patches wrote: > > > Pseud

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-29 Thread Takashi Yano via Cygwin-patches
On Sat, 29 Aug 2020 20:12:28 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Sat, 29 Aug 2020 04:25:54 +0900 > Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Fri, 28 Aug 2020 15:45:03 +0200 > > Corinna Vinschen wrote: >

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-29 Thread Takashi Yano via Cygwin-patches
On Sat, 29 Aug 2020 22:14:20 +0900 Takashi Yano via Cygwin-patches wrote: > On Sat, 29 Aug 2020 20:12:28 +0900 > Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Sat, 29 Aug 2020 04:25:54 +0900 > > Takashi Yano via Cygwin-patches wrote: > >

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-29 Thread Takashi Yano via Cygwin-patches
On Sun, 30 Aug 2020 05:25:06 +0900 Takashi Yano via Cygwin-patches wrote: > On Sat, 29 Aug 2020 22:14:20 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sat, 29 Aug 2020 20:12:28 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > Hi Corinna, > > >

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-30 Thread Takashi Yano via Cygwin-patches
On Sun, 30 Aug 2020 06:13:17 +0900 Takashi Yano via Cygwin-patches wrote: > On Sun, 30 Aug 2020 05:25:06 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sat, 29 Aug 2020 22:14:20 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > On Sat, 29 Aug 2020 20:12:

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-30 Thread Takashi Yano via Cygwin-patches
On Sun, 30 Aug 2020 16:42:17 +0900 Takashi Yano via Cygwin-patches wrote: > On Sun, 30 Aug 2020 06:13:17 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sun, 30 Aug 2020 05:25:06 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > On Sat, 29 Aug 2020 22:14:

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-30 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Sun, 30 Aug 2020 14:49:25 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Aug 29 20:12, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Sat, 29 Aug 2020 04:25:54 +0900 > > Takashi Yano via Cygwin-patches wrote: > > &

Re: [PATCH] Cygwin: pty: Disable pseudo console if TERM is dumb or not set.

2020-08-31 Thread Takashi Yano via Cygwin-patches
Hi Corinna, Thank you for checking the patch. On Mon, 31 Aug 2020 10:16:51 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Aug 31 12:26, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Sun, 30 Aug 2020 14:49:25 +0200 > > Corinna Vinsche

[PATCH v10] Cygwin: pty: Disable pseudo console if TERM does not have CSI6n.

2020-08-31 Thread Takashi Yano via Cygwin-patches
- Pseudo console internally sends escape sequence CSI6n (query cursor position) on startup of non-cygwin apps. If the terminal does not support CSI6n, CreateProcess() hangs waiting for response. To prevent hang, this patch disables pseudo console if the terminal does not have CSI6n. This is

[PATCH] Cygwin: pty: Fix a bug in the code removing set window title sequence.

2020-08-31 Thread Takashi Yano via Cygwin-patches
- Commit 4e08fe42c9f3fdba63a57a8e3a6d705c4e10f50f has a bug which may cause infinite loop in pty_master_fwd_thread(). This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-02 Thread Takashi Yano via Cygwin-patches
On Wed, 2 Sep 2020 10:30:14 +0200 Corinna Vinschen wrote: > On Sep 1 18:19, Johannes Schindelin wrote: > > When `LANG=en_US.UTF-8`, the detected `LCID` is 0x0409, which is > > correct, but after that (at least if Pseudo Console support is enabled), > > we try to find the default code page for that

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-02 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Wed, 2 Sep 2020 10:38:18 +0200 Corinna Vinschen wrote: > On Sep 2 10:30, Corinna Vinschen wrote: > > Ok guys, I'm not opposed to this change in terms of its result, > > but I'm starting to wonder why all this locale code in fhandler_tty > > is necessary at all. > > > > I see that

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-02 Thread Takashi Yano via Cygwin-patches
On Wed, 2 Sep 2020 08:26:04 +0200 (CEST) Johannes Schindelin wrote: > Hi Takashi, > > On Wed, 2 Sep 2020, Takashi Yano via Cygwin-patches wrote: > > > On Wed, 2 Sep 2020 10:30:14 +0200 > > Corinna Vinschen wrote: > > > On Sep 1 18:19, Johannes Schindelin wrot

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-02 Thread Takashi Yano via Cygwin-patches
On Wed, 2 Sep 2020 11:12:53 +0200 (CEST) Johannes Schindelin wrote: > On Wed, 2 Sep 2020, Takashi Yano wrote: > > OK, I will check Angular/CLI next. But I am not familier with > > Agnular/CLI. Could you please provide simple steps to reproduce > > the problem? > > Here is a report: https://github.

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-02 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Wed, 2 Sep 2020 17:24:50 +0200 Corinna Vinschen wrote: > On Sep 2 19:54, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Wed, 2 Sep 2020 10:38:18 +0200 > > Corinna Vinschen wrote: > > > On Sep 2 10:30, Corinna Vinschen wro

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-04 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Thu, 3 Sep 2020 19:59:12 +0200 Corinna Vinschen wrote: > On Sep 2 18:38, Corinna Vinschen wrote: > > Hi Takashi, > > > > On Sep 3 01:25, Takashi Yano via Cygwin-patches wrote: > > > Hi Corinna, > > > > > > On Wed, 2 Sep 2

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-04 Thread Takashi Yano via Cygwin-patches
Hi Johannes and Corinna, On Tue, 1 Sep 2020 18:19:16 +0200 (CEST) Johannes Schindelin wrote: > When `LANG=en_US.UTF-8`, the detected `LCID` is 0x0409, which is > correct, but after that (at least if Pseudo Console support is enabled), > we try to find the default code page for that `LCID`, which

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-04 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 4 Sep 2020 14:44:00 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 4 18:21, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Thu, 3 Sep 2020 19:59:12 +0200 > > Corinna Vinschen wrote: > > > The on

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-04 Thread Takashi Yano via Cygwin-patches
Hi Johannes, On Fri, 4 Sep 2020 08:23:42 +0200 (CEST) Johannes Schindelin wrote: > Hi Takashi, > > On Fri, 4 Sep 2020, Takashi Yano via Cygwin-patches wrote: > > > Hi Johannes and Corinna, > > > > On Tue, 1 Sep 2020 18:19:16 +0200 (CEST) > > Johannes Sc

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-05 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 4 Sep 2020 21:22:35 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 4 23:50, Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Fri, 4 Sep 2020 14:44:00 +0200 > > Corinna Vinschen wrote: > > > On Sep 4 18

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-05 Thread Takashi Yano via Cygwin-patches
On Sat, 5 Sep 2020 17:43:01 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Fri, 4 Sep 2020 21:22:35 +0200 > Corinna Vinschen wrote: > > Hi Takashi, > > > > On Sep 4 23:50, Takashi Yano via Cygwin-patches wrote: > > > Hi Corinna, > &g

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-05 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Sat, 5 Sep 2020 20:15:06 +0900 Takashi Yano via Cygwin-patches wrote: > On Sat, 5 Sep 2020 17:43:01 +0900 > Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Fri, 4 Sep 2020 21:22:35 +0200 > > Corinna Vinschen wrote: > > > H

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-06 Thread Takashi Yano via Cygwin-patches
On Sat, 5 Sep 2020 23:15:16 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Sat, 5 Sep 2020 20:15:06 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sat, 5 Sep 2020 17:43:01 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > Hi Co

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-06 Thread Takashi Yano via Cygwin-patches
On Sun, 6 Sep 2020 17:57:03 +0900 Takashi Yano via Cygwin-patches wrote: > On Sat, 5 Sep 2020 23:15:16 +0900 > Takashi Yano via Cygwin-patches wrote: > > Hi Corinna, > > > > On Sat, 5 Sep 2020 20:15:06 +0900 > > Takashi Yano via Cygwin-patches wrote: > >

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-06 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Fri, 4 Sep 2020 14:44:00 +0200 Corinna Vinschen wrote: > +case 'I': /* ISO-8859-x */ > + codepage = strtoul (charset + 9, NULL, 10); > + break; This should be: codepage = strtoul (charset + 9, NULL, 10) + 28590; shouldn't it? -- Takashi Yano

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-06 Thread Takashi Yano via Cygwin-patches
On Sun, 6 Sep 2020 19:15:30 +0900 Takashi Yano via Cygwin-patches wrote: > On Sun, 6 Sep 2020 17:57:03 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sat, 5 Sep 2020 23:15:16 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > Hi Corinna, > > > >

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-06 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 01:04:13 +0900 Takashi Yano via Cygwin-patches wrote: > On Sun, 6 Sep 2020 19:15:30 +0900 > Takashi Yano via Cygwin-patches wrote: > > On Sun, 6 Sep 2020 17:57:03 +0900 > > Takashi Yano via Cygwin-patches wrote: > > > On Sat, 5 Sep 2020 23:15:16 +

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 10:27:38 +0200 Corinna Vinschen wrote: > On Sep 5 20:15, Takashi Yano via Cygwin-patches wrote: > > On Sat, 5 Sep 2020 17:43:01 +0900 > > Takashi Yano via Cygwin-patches wrote: > > No. This does not fix enough. > > > > In the test case abo

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 10:26:33 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 5 17:43, Takashi Yano via Cygwin-patches wrote: > > On Fri, 4 Sep 2020 21:22:35 +0200 > > Corinna Vinschen wrote: > > > So this boils down to the fact that term_code_page must be set

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 11:08:23 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 7 13:45, Takashi Yano via Cygwin-patches wrote: > > #if 0 /* Let's try this if setting codepage at pty open time is not enough > > */ > > - if (!cygheap->loca

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 18:54:45 +0900 Takashi Yano via Cygwin-patches wrote: > On Mon, 7 Sep 2020 11:08:23 +0200 > Corinna Vinschen wrote: > > Hi Takashi, > > > > On Sep 7 13:45, Takashi Yano via Cygwin-patches wrote: > > > #if 0 /* Let's try this if se

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 10:26:33 +0200 Corinna Vinschen wrote: > processes via cygheap. The idea is to get rid of the complex > setup_locale code in every execve call and just set it once in a process > tree starting at the process creating the ptys. This cause a problem if mintty is started from anot

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
Here is a summary of my points: [Senario 1] 1) Start mintty (UTF-8). 2) Start another mintty by mintty -o charset=SJIS from the first mintty. [Senario 2] int pm = getpt(); if (fork()) { [do the master operations] } else { setsid(); ps = open(ptsname(pm), O_RDWR); cl

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-07 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 18:36:59 +0900 Takashi Yano via Cygwin-patches wrote: > > This is really confusing me. We never set the console codepage in the > > old pty code before, it was just pipes transmitting bytes. Why do we > > suddenly have to handle native apps running in a co

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-08 Thread Takashi Yano via Cygwin-patches
On Mon, 7 Sep 2020 23:17:36 +0200 (CEST) Johannes Schindelin wrote: > Hi Takashi, > > On Sat, 5 Sep 2020, Takashi Yano wrote: > > > On Fri, 4 Sep 2020 08:23:42 +0200 (CEST) > > Johannes Schindelin wrote: > > > > > > On Fri, 4 Sep 2020, Takashi Yano via

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-08 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Tue, 8 Sep 2020 10:40:34 +0200 Corinna Vinschen wrote: > On Sep 7 13:45, Takashi Yano via Cygwin-patches wrote: > > On Mon, 7 Sep 2020 01:04:13 +0900 > > > > Chages: > > > > - If global locale is set, it takes precedence. > > > >

[PATCH] Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon.

2020-09-08 Thread Takashi Yano via Cygwin-patches
- If the non-cygwin apps is executed under pseudo console disabled, multibyte input for the apps are garbled. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/c

Re: [PATCH] Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon.

2020-09-09 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Tue, 8 Sep 2020 20:42:47 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 8 18:57, Takashi Yano via Cygwin-patches wrote: > > - If the non-cygwin apps is executed under pseudo console disabled, > > multibyte input for the apps are garbled. This patch

[PATCH 2/2] Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- If the non-cygwin apps is executed under pseudo console disabled, multibyte input for the apps are garbled. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cy

[PATCH 0/2] Cygwin: pty: Changes regarding charset conversion.

2020-09-09 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: pty: Revise convert_mb_str() function. Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon. winsup/cygwin/fhandler_tty.cc | 135 +++--- 1 file changed, 93 insertions(+), 42 deletions(-) -- 2.28.0

[PATCH 1/2] Cygwin: pty: Revise convert_mb_str() function.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- Use tmp_pathbuf instead of HeapAlloc()/HeapFree(). - Remove mb_str_free() function. - Consider the case where the multibyte string stops in the middle of a multibyte char. --- winsup/cygwin/fhandler_tty.cc | 123 ++ 1 file changed, 82 insertions(+), 41 deletions

Re: [PATCH 1/2] Cygwin: pty: Revise convert_mb_str() function.

2020-09-09 Thread Takashi Yano via Cygwin-patches
On Wed, 9 Sep 2020 17:07:20 +0900 Takashi Yano wrote: > + /* Max bytes in multibyte char is 6. */ > + for (mblen = 1; mblen <= 6; mblen ++) Sorry, I misunderstood that the max utf-8 char length is 6. Actually, it is 4, therefore mbstate_t can be used. I will submit v2 patch. --

[PATCH v2 1/2] Cygwin: pty: Revise convert_mb_str() function.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- Use tmp_pathbuf instead of HeapAlloc()/HeapFree(). - Remove mb_str_free() function. - Consider the case where the multibyte string stops in the middle of a multibyte char. --- winsup/cygwin/fhandler_tty.cc | 118 ++ 1 file changed, 77 insertions(+), 41 deletions

[PATCH v2 2/2] Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- If the non-cygwin apps is executed under pseudo console disabled, multibyte input for the apps are garbled. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cy

[PATCH v2 0/2] Cygwin: pty: Changes regarding charset conversion.

2020-09-09 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: pty: Revise convert_mb_str() function. Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon. winsup/cygwin/fhandler_tty.cc | 130 +++--- 1 file changed, 88 insertions(+), 42 deletions(-) -- 2.28.0

[PATCH v3 0/2] Cygwin: pty: Changes regarding charset conversion.

2020-09-09 Thread Takashi Yano via Cygwin-patches
Takashi Yano (2): Cygwin: pty: Revise convert_mb_str() function. Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon. winsup/cygwin/fhandler_tty.cc | 151 +++--- 1 file changed, 103 insertions(+), 48 deletions(-) -- 2.28.0

[PATCH v3 2/2] Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- If the non-cygwin apps is executed under pseudo console disabled, multibyte input for the apps are garbled. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsu

[PATCH v3 1/2] Cygwin: pty: Revise convert_mb_str() function.

2020-09-09 Thread Takashi Yano via Cygwin-patches
- Use tmp_pathbuf instead of HeapAlloc()/HeapFree(). - Remove mb_str_free() function. - Consider the case where the multibyte string stops in the middle of a multibyte char. --- winsup/cygwin/fhandler_tty.cc | 135 ++ 1 file changed, 88 insertions(+), 47 deletions

Re: [PATCH v3 0/2] Cygwin: pty: Changes regarding charset conversion.

2020-09-09 Thread Takashi Yano via Cygwin-patches
On Wed, 9 Sep 2020 23:46:04 +0200 Corinna Vinschen wrote: > On Sep 10 00:27, Takashi Yano via Cygwin-patches wrote: > > Takashi Yano (2): > > Cygwin: pty: Revise convert_mb_str() function. > > Cygwin: pty: Fix input charset for non-cygwin apps with disable_pcon. &g

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-09 Thread Takashi Yano via Cygwin-patches
Hi Corinna, On Wed, 9 Sep 2020 09:21:23 +0200 Corinna Vinschen wrote: > On Sep 8 17:16, Takashi Yano via Cygwin-patches wrote: > > On Mon, 7 Sep 2020 23:17:36 +0200 (CEST) > > Johannes Schindelin wrote: > > > Hi Takashi, > > > > > > On Sat, 5 Sep 2020,

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-10 Thread Takashi Yano via Cygwin-patches
On Thu, 10 Sep 2020 09:15:00 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Wed, 9 Sep 2020 09:21:23 +0200 > Corinna Vinschen wrote: > > On Sep 8 17:16, Takashi Yano via Cygwin-patches wrote: > > > On Mon, 7 Sep 2020 23:17:36 +0200 (CEST) >

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-10 Thread Takashi Yano via Cygwin-patches
On Tue, 8 Sep 2020 18:45:36 +0900 Takashi Yano via Cygwin-patches wrote: > Hi Corinna, > > On Tue, 8 Sep 2020 10:40:34 +0200 > Corinna Vinschen wrote: > > On Sep 7 13:45, Takashi Yano via Cygwin-patches wrote: > > > On Mon, 7 Sep 2020 01:04:13 +0900 > > &g

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-10 Thread Takashi Yano via Cygwin-patches
On Thu, 10 Sep 2020 16:04:07 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Sep 10 09:15, Takashi Yano via Cygwin-patches wrote: > > On Wed, 9 Sep 2020 09:21:23 +0200 > > Corinna Vinschen wrote: > > > Takashi, does the patch from > > > https://cygw

Re: [PATCH 3/3] fhandler_pty_slave::setup_locale: respect charset == "UTF-8"

2020-09-10 Thread Takashi Yano via Cygwin-patches
On Thu, 10 Sep 2020 23:16:10 +0900 Takashi Yano wrote: > On Thu, 10 Sep 2020 16:04:07 +0200 > Corinna Vinschen wrote: > > > Hi Takashi, > > > > On Sep 10 09:15, Takashi Yano via Cygwin-patches wrote: > > > On Wed, 9 Sep 2020 09:21:23 +0200 > > >

[PATCH] Cygwin: pty: Add workaround for ISO-2022 and ISCII in convert_mb_str().

2020-09-11 Thread Takashi Yano via Cygwin-patches
- In convert_mb_str(), exclude ISO-2022 and ISCII from the processing for the case that the multibyte char is splitted in the middle. The reason is as follows. * ISO-2022 is too complicated to handle correctly. * Not sure what to do with ISCII. --- winsup/cygwin/fhandler_tty.cc | 9 +++

  1   2   3   >