Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-23 Thread Takashi Yano
On Thu, 23 Jan 2020 21:39:50 +0800 Koichi Murase wrote: > 0 [main] () shared_info::initialize: size of shared > memory region changed from 50104 to 49080 Is there any process alived using diffrent version of cygwin1.dll? -- Takashi Yano

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-23 Thread Takashi Yano
On Thu, 23 Jan 2020 13:51:54 +0100 Corinna Vinschen wrote: > On Jan 23 13:30, Takashi Yano wrote: > > - After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of > > cygwin programs which call both printf() and WriteConsole() are > > frequently distorted. This

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-23 Thread Takashi Yano
On Thu, 23 Jan 2020 13:51:54 +0100 Corinna Vinschen wrote: > On Jan 23 13:30, Takashi Yano wrote: > > - After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of > > cygwin programs which call both printf() and WriteConsole() are > > frequently distorted. This

[PATCH] Cygwin: console: Share readahead buffer within the same process.

2020-01-25 Thread Takashi Yano
- The cause of the problem reported in https://www.cygwin.com/ml/cygwin/2020-01/msg00220.html is that the chars input before dup() cannot be read from the new file descriptor. This is because the readahead buffer (rabuf) in the console is newly created by dup(), and does not inherit from th

Re: [PATCH] Cygwin: pty: Add missing console API hooks.

2020-01-25 Thread Takashi Yano
Hi Corinna, On Fri, 24 Jan 2020 11:26:27 +0100 Corinna Vinschen wrote: > On Jan 23 22:05, Takashi Yano wrote: > > On Thu, 23 Jan 2020 13:48:13 +0100 > > Corinna Vinschen wrote: > > > On Jan 23 13:33, Takashi Yano wrote: > > > > - Following console APIs are add

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-25 Thread Takashi Yano
ot; is needed before switching. I had tried WriteFile(), ReadFile() and DeviceIoControl() for HANDLE hConDrvReference, however, all atempts of them failed. -- Takashi Yano

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-26 Thread Takashi Yano
Hi Corinna, On Sat, 25 Jan 2020 20:38:37 +0900 Takashi Yano wrote: > On Fri, 24 Jan 2020 12:07:30 +0100 > Corinna Vinschen wrote: > > Too bad. It's pretty strange that CreatePseudoConsole returns a > > valid HPCON but then isn't ready to take input immediately. >

[PATCH v3] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-26 Thread Takashi Yano
- After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of cygwin programs which call both printf() and WriteConsole() are frequently distorted. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/fhandler_tty.cc | 40 +++---

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-26 Thread Takashi Yano
On Sun, 26 Jan 2020 22:33:19 +0900 Takashi Yano wrote: > On Sat, 25 Jan 2020 20:38:37 +0900 > Takashi Yano wrote: > > On Fri, 24 Jan 2020 12:07:30 +0100 > > Corinna Vinschen wrote: > > > Too bad. It's pretty strange that CreatePseudoConsole returns a > > >

[PATCH v4] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-26 Thread Takashi Yano
- After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of cygwin programs which call both printf() and WriteConsole() are frequently distorted. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/fhandler_tty.cc | 46 --

Re: [PATCH v2] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-26 Thread Takashi Yano
On Mon, 27 Jan 2020 11:38:22 +0900 Takashi Yano wrote: > On Sun, 26 Jan 2020 22:33:19 +0900 > Takashi Yano wrote: > > On Sat, 25 Jan 2020 20:38:37 +0900 > > Takashi Yano wrote: > > > On Fri, 24 Jan 2020 12:07:30 +0100 > > > Corinna Vinschen wrote: > &

[PATCH v5] Cygwin: pty: Revise code waiting for forwarding again.

2020-01-27 Thread Takashi Yano
- After commit 6cc299f0e20e4b76f7dbab5ea8c296ffa4859b62, outputs of cygwin programs which call both printf() and WriteConsole() are frequently distorted. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_tty.cc | 37 +--

[PATCH v2] Cygwin: console: Share readahead buffer within the same process.

2020-01-27 Thread Takashi Yano
- The cause of the problem reported in https://www.cygwin.com/ml/cygwin/2020-01/msg00220.html is that the chars input before dup() cannot be read from the new file descriptor. This is because the readahead buffer (rabuf) in the console is newly created by dup(), and does not inherit from th

[PATCH] Cygwin: console: Revise color setting codes in legacy console mode.

2020-01-31 Thread Takashi Yano
- With this patch, foreground color and background color are allowed to be set simultaneously by escape sequence such as ESC[38;2;0;0;255;48;2;128;128;0m in legacy console mode. --- winsup/cygwin/fhandler_console.cc | 38 --- 1 file changed, 20 insertions(+), 18 del

[PATCH v2] Cygwin: console: Revise color setting codes in legacy console mode.

2020-01-31 Thread Takashi Yano
- With this patch, foreground color and background color are allowed to be set simultaneously by 24 bit color escape sequence such as ESC[38;2;0;0;255;48;2;128;128;0m in legacy console mode. --- winsup/cygwin/fhandler.h | 2 +- winsup/cygwin/fhandler_console.cc | 47 +

[PATCH] Cygwin: pty: Remove meaningless pointer increment.

2020-02-04 Thread Takashi Yano
- Since commit 73742508fcd8e994450582c1b7296c709da66764, a pointer increment in master write code which has no effect was remaining. --- 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

[PATCH] Cygwin: pty: Use pinfo() rather than kill() with signal 0.

2020-02-06 Thread Takashi Yano
- PTY code has a problem that tcsh is terminated if the following command is executed. true; chcp & This seems to be caused by invalid pointer access which occurs when the process exits during the kill() code is execuetd. This patch avoids the issue by not using kill(). --- winsup/cygw

Re: [PATCH] Cygwin: pty: Use pinfo() rather than kill() with signal 0.

2020-02-08 Thread Takashi Yano
3.1.3. I am planning to divide one of them into several patches. I will submit these patches in a few days. -- Takashi Yano

[PATCH 2/4] Cygwin: pty: Avoid screen distortion on slave read.

2020-02-09 Thread Takashi Yano
- Echo back print is distorted when the cygwin program which calls Win32 console API directly calls slave read(). This patch fixes the issue. --- winsup/cygwin/fhandler.h | 3 ++- winsup/cygwin/fhandler_tty.cc | 51 --- 2 files changed, 32 insertions(+), 2

[PATCH 4/4] Cygwin: pty: Add missing member initialization for struct pipe_reply.

2020-02-09 Thread Takashi Yano
- For pseudo console support, struct pipe_reply was changed in the past, however, the initialization was not fixed. --- 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 36b3341b1.

[PATCH 3/4] Cygwin: pty: Remove debug codes and organize related codes.

2020-02-09 Thread Takashi Yano
- Debug codes used in the early stage of pseudo console support are removed. (Regarding ALWAYS_USE_PCON and USE_API_HOOK) Along with this, the codes related to this change are organized. --- winsup/cygwin/fhandler_tty.cc | 81 ++- winsup/cygwin/select.cc |

[PATCH 1/4] Cygwin: pty: Define mask_switch_to_pcon_in() in fhandler_tty.cc.

2020-02-09 Thread Takashi Yano
- This patch moves the definition of mask_switch_to_pcon() from fhandler.h to fhandler_tty.cc. --- winsup/cygwin/fhandler.h | 9 + winsup/cygwin/fhandler_tty.cc | 10 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin

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

2020-02-09 Thread Takashi Yano
- PTY has a problem that the key input, which is typed during windows native app is running, disappear when it returns to shell. (Problem 3 in https://cygwin.com/ml/cygwin/2020-02/msg7.html) This is beacuse pty has two input pipes, one is for cygwin apps and the other one is for native

[PATCH] Cygwin: pty: Fix state mismatch caused in mintty.

2020-02-09 Thread Takashi Yano
- PTY has a bug reported in: https://cygwin.com/ml/cygwin/2020-02/msg00067.html. This is the result of state mismatch between real pseudo console attaching state and state variable. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 16 ++-- winsup/cygwin/fork.cc

[PATCH 0/4] Remove debug codes and organize with some fixes.

2020-02-09 Thread Takashi Yano
Takashi Yano (4): Cygwin: pty: Define mask_switch_to_pcon_in() in fhandler_tty.cc. Cygwin: pty: Avoid screen distortion on slave read. Cygwin: pty: Remove debug codes and organize related codes. Cygwin: pty: Add missing member initialization for struct pipe_reply. winsup/cygwin

Re: [PATCH] Cygwin: pty: Use pinfo() rather than kill() with signal 0.

2020-02-09 Thread Takashi Yano
On Sat, 8 Feb 2020 23:53:11 +0900 Takashi Yano wrote: > On Thu, 6 Feb 2020 20:03:30 +0100 > Corinna Vinschen wrote: > > I'm inclined to release 3.1.3 next week. Is that ok with you or > > do you anticipate more patches which should go into 3.1.3? > > Currently, I hav

[PATCH] Cygwin: pty: Prevent potential errno overwriting.

2020-02-10 Thread Takashi Yano
- In push_to_pcon_screenbuffer(), open() and ioctl() are called. Since push_to_pcon_screenbuffer() is called in read() and write(), errno which is set in read() and write() code may be overwritten in open() or ioctl() call. This patch prevent this situation. --- winsup/cygwin/fhandler_tty.cc

Re: [PATCH] Cygwin: pty: Use pinfo() rather than kill() with signal 0.

2020-02-10 Thread Takashi Yano
Hi Corinna, On Mon, 10 Feb 2020 00:06:03 +0900 Takashi Yano wrote: > On Sat, 8 Feb 2020 23:53:11 +0900 > Takashi Yano wrote: > > On Thu, 6 Feb 2020 20:03:30 +0100 > > Corinna Vinschen wrote: > > > I'm inclined to release 3.1.3 next week. Is that ok with you

Re: [PATCH v2] Cygwin: pty: Introduce disable_pcon in environment CYGWIN.

2020-02-10 Thread Takashi Yano
On Mon, 10 Feb 2020 11:07:10 +0100 Corinna Vinschen wrote: > On Feb 8 18:13, Thomas Wolff wrote: > > On 22.01.2020 11:06, Corinna Vinschen wrote: > > > On Jan 21 22:25, Takashi Yano wrote: > > > > - For programs which does not work properly with pseudo conso

[PATCH] Cygwin: pty: Add error handling in setup_pseudoconsoe().

2020-02-10 Thread Takashi Yano
- In setup_pseudoconsole(), many error handling was omitted. This patch adds missing error handling. --- winsup/cygwin/fhandler_tty.cc | 94 +-- 1 file changed, 68 insertions(+), 26 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_

Re: [PATCH] Cygwin: pty: Add error handling in setup_pseudoconsoe().

2020-02-10 Thread Takashi Yano
[PATCH] Cygwin: pty: Add error handling in setup_pseudoconsoe(). s/pseudoconsoe/pseudoconsole/

[PATCH v2] Cygwin: pty: Add error handling in setup_pseudoconsole().

2020-02-10 Thread Takashi Yano
- In setup_pseudoconsole(), many error handling was omitted. This patch adds missing error handling. --- winsup/cygwin/fhandler_tty.cc | 179 +- 1 file changed, 111 insertions(+), 68 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler

[PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-16 Thread Takashi Yano
- If two cygwin programs are executed simultaneousley with pipes in cmd.exe, xterm compatible mode is accidentally disabled by the process which ends first. After that, escape sequences are not handled correctly in the other app. This is the problem 2 reported in https://cygwin.com/ml/cygwi

Re: [PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
On Mon, 17 Feb 2020 10:00:15 +0100 Corinna Vinschen wrote: > On Feb 16 17:13, Takashi Yano wrote: > > - If two cygwin programs are executed simultaneousley with pipes > > in cmd.exe, xterm compatible mode is accidentally disabled by > > the process which ends firs

Re: [PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
On Mon, 17 Feb 2020 11:16:50 +0100 Corinna Vinschen wrote: > On Feb 17 18:45, Takashi Yano wrote: > > On Mon, 17 Feb 2020 10:00:15 +0100 > > Corinna Vinschen wrote: > > > On Feb 16 17:13, Takashi Yano wrote: > > > > - If two cygwin programs are executed sim

[PATCH v2] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
- If two cygwin programs are executed simultaneousley with pipes in cmd.exe, xterm compatible mode is accidentally disabled by the process which ends first. After that, escape sequences are not handled correctly in the other app. This is the problem 2 reported in https://cygwin.com/ml/cygwi

Re: [PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
On Mon, 17 Feb 2020 11:16:50 +0100 Corinna Vinschen wrote: > On Feb 17 18:45, Takashi Yano wrote: > > On Mon, 17 Feb 2020 10:00:15 +0100 > > Corinna Vinschen wrote: > > > On Feb 16 17:13, Takashi Yano wrote: > > > > - If two cygwin programs are executed sim

[PATCH] Cygwin: console: Fix code for restoring console mode.

2020-02-17 Thread Takashi Yano
- Commit 774b8996d1f3e535e8267be4eb8e751d756c2cec has a bug that restores console output mode into console input. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cy

[PATCH] Cygwin: console: Add guard for set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
- Setting / unsetting xterm compatible mode may cause race issue between multiple processes. This patch adds guard for that. --- winsup/cygwin/fhandler.h | 6 ++ winsup/cygwin/fhandler_console.cc | 123 +- winsup/cygwin/select.cc | 22 ++ win

[PATCH] Cygwin: console: Fix ioctl() FIONREAD.

2020-02-17 Thread Takashi Yano
- ioctl() FIONREAD for console does not return correct value since commit cfb517f39a8bcf2d995a732d250563917600408a. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 37 +++ 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/winsup/cygw

Re: [PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-17 Thread Takashi Yano
Hi Corinna, On Mon, 17 Feb 2020 18:45:45 +0900 Takashi Yano wrote: > On Mon, 17 Feb 2020 10:28:19 +0100 > Corinna Vinschen wrote: > > On second thought, also consider that switching the mode and > > reading/writing is not atomic. You'd either have to add locking, or you

[PATCH v2] Cygwin: console: Add guard for set/unset xterm compatible mode.

2020-02-18 Thread Takashi Yano
- Setting / unsetting xterm compatible mode may cause race issue between multiple processes. This patch adds guard for that. --- winsup/cygwin/fhandler.h | 6 ++ winsup/cygwin/fhandler_console.cc | 125 +- winsup/cygwin/select.cc | 22 ++ win

Re: [PATCH] Cygwin: console: Change timing of set/unset xterm compatible mode.

2020-02-18 Thread Takashi Yano
On Tue, 18 Feb 2020 13:08:46 +0900 Takashi Yano wrote: > On Mon, 17 Feb 2020 18:45:45 +0900 > Takashi Yano wrote: > > On Mon, 17 Feb 2020 10:28:19 +0100 > > Corinna Vinschen wrote: > > > On second thought, also consider that switching the mode and > > > reading/

Re: [PATCH v2] Cygwin: console: Add guard for set/unset xterm compatible mode.

2020-02-18 Thread Takashi Yano
On Tue, 18 Feb 2020 11:43:36 +0100 Corinna Vinschen wrote: > On Feb 18 18:12, Takashi Yano wrote: > > - Setting / unsetting xterm compatible mode may cause race issue > > between multiple processes. This patch adds guard for that. > > --- > > winsup/cygwi

[PATCH] Cygwin: console: Ignore 0x00 on write().

2020-02-20 Thread Takashi Yano
- In xterm compatible mode, 0x00 on write() behaves incompatible with real xterm. In xterm, 0x00 completely ignored. Therefore, 0x00 is ignored by console with this patch. --- winsup/cygwin/fhandler_console.cc | 10 ++ 1 file changed, 10 insertions(+) diff --git a/winsup/cygwin/fhandl

Re: [PATCH] Cygwin: console: Ignore 0x00 on write().

2020-02-20 Thread Takashi Yano
On Thu, 20 Feb 2020 14:44:59 +0100 Corinna Vinschen wrote: > On Feb 20 14:35, Corinna Vinschen wrote: > > On Feb 20 20:51, Takashi Yano wrote: > > > - In xterm compatible mode, 0x00 on write() behaves incompatible > > > with real xterm. In xterm, 0x00 completely ignor

Re: [PATCH] Cygwin: console: Ignore 0x00 on write().

2020-02-20 Thread Takashi Yano
On Thu, 20 Feb 2020 15:22:45 +0100 Corinna Vinschen wrote: > On Feb 20 23:13, Takashi Yano wrote: > > On Thu, 20 Feb 2020 14:44:59 +0100 > > Corinna Vinschen wrote: > > > On Feb 20 14:35, Corinna Vinschen wrote: > > > > On Feb 20 20:51, Takashi Yano wrote:

[PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-21 Thread Takashi Yano
- Accessing shared_console_info accidentaly causes segmentation fault when it is a NULL pointer. The cause of the problem reported in https://cygwin.com/ml/cygwin/2020-02/msg00197.html is this NULL pointer access in request_xterm_mode_output(). This patch fixes the issue. --- winsup/cygwin

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-22 Thread Takashi Yano
Hi Corinna, On Fri, 21 Feb 2020 20:43:33 +0100 Corinna Vinschen wrote: > On Feb 22 04:10, Takashi Yano wrote: > > - Accessing shared_console_info accidentaly causes segmentation > > fault when it is a NULL pointer. The cause of the problem reported > > in https://cygwin.

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-22 Thread Takashi Yano
On Sat, 22 Feb 2020 17:01:23 +0900 Takashi Yano wrote: > Hi Corinna, > > On Fri, 21 Feb 2020 20:43:33 +0100 > Corinna Vinschen wrote: > > On Feb 22 04:10, Takashi Yano wrote: > > > - Accessing shared_console_info accidentaly causes segmentation > > > fault

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-24 Thread Takashi Yano
o occurs in wsl. /bin/echo -e '\033[H\033[5L' causes the similar result. The following code cause the problem as well. #include int main() { CONSOLE_SCREEN_BUFFER_INFO sbi; SMALL_RECT r; COORD c = {0, 0}; CHAR_INFO f = {' ', 0}; HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); DWORD n; ReadConsoleOutputAttribute(h, &f.Attributes, 1, c, &n); GetConsoleScreenBufferInfo(h, &sbi); c.X = 0; c.Y = sbi.srWindow.Top + 5; ScrollConsoleScreenBuffer(h, &sbi.srWindow, NULL, c, &f); return 0; } -- Takashi Yano

[PATCH v2] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-24 Thread Takashi Yano
- Accessing shared_console_info before initialization causes access violation because it is a NULL pointer. The cause of the problem reported in https://cygwin.com/ml/cygwin/2020-02/msg00197.html is this NULL pointer access in request_xterm_mode_output() when it is called from close(). This

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-24 Thread Takashi Yano
een gets into black background and gray fore- ground. Do not these happen in your environment? Oh, wait. I was setting foreground and background color in "terminal" tab in property. If I set them in "colors" tab, cmd.exe behaves differently. In this setting, your problem does not seems to occur. -- Takashi Yano

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-24 Thread Takashi Yano
On Tue, 25 Feb 2020 12:08:16 +0900 Takashi Yano wrote: > On Mon, 24 Feb 2020 19:33:18 +0100 > Corinna Vinschen wrote: > > Is there some kind of workaround for that problem? Otherwise defaulting > > to a (broken) xterm mode instead of a (working) cygwin mode is a bit > >

Re: [PATCH] Cygwin: console: Fix segfault on shared_console_info access.

2020-02-25 Thread Takashi Yano
t; make a workaround for this. I will try. > > That would be great! I have successfully made a workaround for this issue. I will submit it shortly. -- Takashi Yano

[PATCH 0/2] Modify handling of several ESC sequences in xterm mode.

2020-02-25 Thread Takashi Yano
Takashi Yano (2): Cygwin: console: Add workaround for broken IL/DL in xterm mode. Cygwin: console: Add support for REP escape sequence to xterm mode. winsup/cygwin/fhandler_console.cc | 215 ++ winsup/cygwin/wincap.cc | 20 +++ winsup/cygwin/wincap.h

[PATCH 1/2] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-25 Thread Takashi Yano
- Cygwin console with xterm compatible mode causes problem reported in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html if background/foreground colors are set to gray/black respectively in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M" (DL) and "ESC M" (RI) co

[PATCH 2/2] Cygwin: console: Add support for REP escape sequence to xterm mode.

2020-02-25 Thread Takashi Yano
- In Win10 upto 1809, xterm compatible mode does not have REP escape sequence which terminfo declares. This patch adds support for "CSI Ps b" (REP). With this patch, bvi (binary editor) works normally in Win10 1809. Also, xterm compatible mode does not have "CSI Pm `" (HPA), "CSI Pm a" (HPR

Re: [PATCH 1/2] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Takashi Yano
Hi Corinna, On Wed, 26 Feb 2020 02:14:37 +0900 Takashi Yano wrote: > - Cygwin console with xterm compatible mode causes problem reported > in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html > if background/foreground colors are set to gray/black respectively > i

[PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Takashi Yano
- Cygwin console with xterm compatible mode causes problem reported in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html if background/foreground colors are set to gray/black respectively in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M" (DL) and "ESC M" (RI) co

[PATCH v2 2/4] Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.

2020-02-26 Thread Takashi Yano
- This patch unifies workaround code for CSI3J and CSI?1049h/l into the code handling other escape sequences in xterm mode. --- winsup/cygwin/fhandler_console.cc | 43 --- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/winsup/cygwin/fhandler_console.c

[PATCH v2 4/4] Cygwin: console: Add emulation of CSI3J on Win10 1809.

2020-02-26 Thread Takashi Yano
- This patch add emulation of CSI3J, which is broken in Win10 1809, rather than ignoring it as before. --- winsup/cygwin/fhandler_console.cc | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_consol

[PATCH v2 3/4] Cygwin: console: Add support for REP escape sequence to xterm mode.

2020-02-26 Thread Takashi Yano
- In Win10 upto 1809, xterm compatible mode does not have REP escape sequence which terminfo declares. This patch adds support for "CSI Ps b" (REP). With this patch, bvi (binary editor) works normally in Win10 1809. Also, xterm compatible mode does not have "CSI Pm `" (HPA), "CSI Pm a" (HPR

[PATCH v2 0/4] Modify handling of several ESC sequences in xterm mode.

2020-02-26 Thread Takashi Yano
Takashi Yano (4): Cygwin: console: Add workaround for broken IL/DL in xterm mode. Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l. Cygwin: console: Add support for REP escape sequence to xterm mode. Cygwin: console: Add emulation of CSI3J on Win10 1809. winsup/cygwin

[PATCH] Cygwin: console: Adjust the detailed behaviour of ESC sequences.

2020-02-26 Thread Takashi Yano
- This patch makes some detailed behaviour of ESC sequences such as "CSI Ps L" (IL), "CSI Ps M" (DL) and "ESC M" (RI) in xterm mode match with real xterm. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_console.cc | 51 ++- 2 files changed, 45 i

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-27 Thread Takashi Yano
ch for this issue, may I leave it to you because you are already working on it? -- Takashi Yano

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-28 Thread Takashi Yano
I think it is already thread-safe. -- Takashi Yano

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-29 Thread Takashi Yano
ows. Total1: 2.315627 second Total2: 1.588511 second Total3: 1.571572 second Class implementation is slow 40% than inline or macro. So, IMHO, inline static function is the best. -- Takashi Yano #include #include #define WPBUF_LEN 256 class { private: unsigned char buf[WPBUF_LEN]; int ixput;

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-29 Thread Takashi Yano
t++] = x; > >} Indeed. You are right. Thanks for pointing out that. Another similar problem exists in console code of escape sequence handling, so I will submit a patch for that. As for wpbuf, please continue to fix. -- Takashi Yano

Re: [PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-03-01 Thread Takashi Yano
On Sun, 1 Mar 2020 14:56:31 +0100 Hans-Bernhard Bröker wrote: > Am 01.03.2020 um 07:33 schrieb Takashi Yano: > > > However, from the view point of performance, just inline > > static function is better. > > I don't see how that could be the case. Inline methods of

[PATCH 1/4] Cygwin: console: Revise the code to fix tab position.

2020-03-01 Thread Takashi Yano
- This patch fixes the issue that the cursor position is broken if window size is changed while executing vim, less etc. --- winsup/cygwin/fhandler_console.cc | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/f

[PATCH 0/4] Cygwin: console: Some fixes for console in xterm mode.

2020-03-01 Thread Takashi Yano
Takashi Yano (4): Cygwin: console: Revise the code to fix tab position. Cygwin: console: Fix setting/unsetting xterm mode for input. Cygwin: console: Prevent buffer overrun. Cygwin: console: Add a workaround for "ESC 7" and "ESC 8". winsup/cygwin/fhandler.h |

[PATCH 3/4] Cygwin: console: Prevent buffer overrun.

2020-03-01 Thread Takashi Yano
- This patch prevent potential buffer overrun in the code handling escape sequences. --- winsup/cygwin/fhandler_console.cc | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 9c5b8018

[PATCH 2/4] Cygwin: console: Fix setting/unsetting xterm mode for input.

2020-03-01 Thread Takashi Yano
- This patch fixes the issue that xterm compatible mode for input is not correctly set/unset in some situation such as: 1) cat is stopped by ctrl-c. 2) The window size is changed in less. In case 1), request_xterm_mode_input(true) is called in read(), however, cat is stopped without req

[PATCH 4/4] Cygwin: console: Add a workaround for "ESC 7" and "ESC 8".

2020-03-01 Thread Takashi Yano
- In xterm compatible mode, "ESC 7" and "ESC 8" do not work properly in the senario: 1) Execute /bin/ls /bin to fill screen. 2) Sned CSI?1049h to alternate screen. 3) Reduce window size. 4) Send CSI?1049l to resume screen. 5) Send "ESC 7" and "ESC 8". After sending "ESC 8", the c

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-02 Thread Takashi Yano
covered up like: inline void sendOut (HANDLE &handle) { DWORD wn; WriteConsoleA (handle, buf, ixput, &wn, 0); } -- Takashi Yano

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Takashi Yano
output_handle (), wpbuf, wpixput, &n, 0); con.state = normal; wpixput = 0; // <--- Here So, this might not be worth much... -- Takashi Yano

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Takashi Yano
inline void sendOut (HANDLE &handle) > { >WriteConsoleA (handle, buf, ixput, 0, 0); > } > > The same would apply to all the other calls of WriteConsoleA, it seems. Yeah, it could be. However, please note that it should be saparate patch if you remove wn from WriteConsoleA() other than wpbuf related. -- Takashi Yano

[PATCH] Cygwin: console: Fix behaviour of "ESC 8" after reset.

2020-03-05 Thread Takashi Yano
- This patch matches the behaviour of "ESC 8" (DECRC) to the real xterm after full reset (RIS), soft reset (DECSTR) and "CSI 3 J". --- winsup/cygwin/fhandler_console.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.

Re: [PATCH] Cygwin: console: Fix behaviour of "ESC 8" after reset.

2020-03-08 Thread Takashi Yano
On Fri, 6 Mar 2020 10:55:28 +0900 Takashi Yano wrote: > - This patch matches the behaviour of "ESC 8" (DECRC) to the real > xterm after full reset (RIS), soft reset (DECSTR) and "CSI 3 J". > --- > winsup/cygwin/fhandler_console.cc | 7 +++ > 1 file chan

[PATCH v2] Cygwin: console: Fix behaviour of "ESC 8" after reset.

2020-03-08 Thread Takashi Yano
- This patch matches the behaviour of "ESC 8" (DECRC) to the real xterm after full reset (RIS), soft reset (DECSTR) and "CSI 3 J". --- winsup/cygwin/fhandler_console.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.

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

2021-03-23 Thread Takashi Yano
On Tue, 23 Mar 2021 14:32:39 +0100 Corinna Vinschen wrote: > On Mar 23 21:52, Takashi Yano via Cygwin-patches wrote: > > On Tue, 23 Mar 2021 21:42:06 +0900 > > Takashi Yano wrote: > > > On Tue, 23 Mar 2021 21:32:12 +0900 > > > Takashi Yano wrote: > > &

[PATCH] Cygwin: fhandler: Rename handles from XXX_cyg/XXX to XXX/XXX_nat.

2021-04-05 Thread Takashi Yano
- Currently, functions/variables regarding the handles for cygwin apps are with "_cyg", and those of handles for non-cygwin apps are without "_cyg", such as get_handle_cyg() and get_handle(). This patch renames these to the names without "_nat" and with "_nat" respectively, such as get_hand

[PATCH] Cygwin: pty: Use atexit() instead of hooking exit() for GDB.

2021-04-05 Thread Takashi Yano
- This patch utilizes atexit() instead of hooking exit() to clean up pseudo console stuff when debugging non-cygwin app using GDB. --- winsup/cygwin/fhandler.h | 2 +- winsup/cygwin/fhandler_tty.cc | 98 +++ winsup/cygwin/tty.cc | 2 + 3 files chan

[PATCH] Cygwin: pty: Use find_exec() rather than path_conv::check().

2021-04-05 Thread Takashi Yano
- With this patch, find_exec() rather than path_conv::check() is used in order to enable searching executable file in the path. --- winsup/cygwin/fhandler_tty.cc | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cy

[PATCH v2] Cygwin: pty: Use atexit() instead of hooking exit() for GDB.

2021-04-05 Thread Takashi Yano
- This patch utilizes atexit() instead of hooking exit() to clean up pseudo console stuff when debugging non-cygwin app using GDB. --- winsup/cygwin/fhandler.h | 2 +- winsup/cygwin/fhandler_tty.cc | 100 +++--- winsup/cygwin/tty.cc | 2 + 3 files ch

[PATCH 0/2] Fix race issues.

2021-04-19 Thread Takashi Yano
Takashi Yano (2): Cygwin: console: Fix race issue regarding cons_master_thread(). Cygwin: pty: Fix race issue in inheritance of pseudo console. winsup/cygwin/fhandler_console.cc | 10 ++- winsup/cygwin/fhandler_tty.cc | 108 ++ winsup/cygwin/tty.cc

[PATCH 1/2] Cygwin: console: Fix race issue regarding cons_master_thread().

2021-04-19 Thread Takashi Yano
- With this patch, the race issue regarding starting/stopping cons_master_thread() introduced by commit ff4440fc is fixed. Addresses: https://cygwin.com/pipermail/cygwin/2021-April/248292.html --- winsup/cygwin/fhandler_console.cc | 10 -- 1 file changed, 8 insertions(+), 2 deleti

[PATCH 2/2] Cygwin: pty: Fix race issue in inheritance of pseudo console.

2021-04-19 Thread Takashi Yano
- If multiple non-cygwin processes are started/ended simultaneously, inheritance of pseudo console sometimes fails. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2021-April/248292.html --- winsup/cygwin/fhandler_tty.cc | 108 -

[PATCH] Cygwin: console: Fix a bug in the code to fix tab position.

2021-04-19 Thread Takashi Yano
- With this patch, a bug in the code to fix tab position after resizing window is fixed. --- winsup/cygwin/fhandler_console.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 43e404ed6..0812e91f0 100

[PATCH] Cygwin: pty: Make rlwrap work with cmd.exe.

2021-04-19 Thread Takashi Yano
- After the commit 919dea66, "rlwrap cmd" fails to start pseudo console. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index ba9f4117f..d44728795 100644 --- a/winsu

Re: [PATCH] Cygwin: pty: Make rlwrap work with cmd.exe.

2021-04-19 Thread Takashi Yano
On Mon, 19 Apr 2021 16:19:09 +0200 Corinna Vinschen wrote: > Hi Takashi, > > On Apr 19 20:51, Takashi Yano wrote: > > - After the commit 919dea66, "rlwrap cmd" fails to start pseudo > > console. This patch fixes the issue. > > --- > > winsup/cygwin/fh

[PATCH] Cygwin: pty: Additional race issue fix regarding pseudo console.

2021-04-20 Thread Takashi Yano
- In commit bb93c6d7, the race issue was not completely fixed. In the pseudo console inheritance, if the destination process to which the ownership of pseudo console switches, is found but exits before switching, the inheritance fails. Currently, this extremely rarely happens. This patch fi

[PATCH] Cygwin: pty: Fix fallback processing in setup_pseudoconsole().

2021-04-20 Thread Takashi Yano
- Currently, the fallback processing in setup_pseudoconsole() when helper process error occurs does not work properly. This patch fixes the issue. --- winsup/cygwin/fhandler_tty.cc | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/

[PATCH] Cygwin: pty: Add missing guard for close_pseudoconsole().

2021-04-20 Thread Takashi Yano
- This patch adds a missing mutex guard for close_pseudoconsole() call when GDB exits. --- winsup/cygwin/fhandler_tty.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 530321513..9c03e09a7 100644 --- a/winsup/cygwin/fhand

[PATCH] Cygwin: console: Fix garbled input for non-ASCII chars.

2021-06-23 Thread Takashi Yano
- After the commit ff4440fc, non-ASCII input may sometimes be garbled. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2021-June/248775.html --- winsup/cygwin/fhandler_console.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/f

[PATCH v2] Cygwin: console: Fix garbled input for non-ASCII chars.

2021-06-23 Thread Takashi Yano
- After the commit ff4440fc, non-ASCII input may sometimes be garbled. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2021-June/248775.html --- winsup/cygwin/fhandler_console.cc | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/win

[PATCH] Cygwin: pty: Fix error handling of master write().

2021-09-07 Thread Takashi Yano
- Currently, error handling of write() in pty master side is broken. This patch fixes that. --- winsup/cygwin/fhandler_termios.cc | 24 +++- winsup/cygwin/fhandler_tty.cc | 11 +++ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/winsup/cygwin/fhan

Re: [PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit

2021-10-08 Thread Takashi Yano
) { - buf->st_atim = buf->st_mtim = clipbuf->timestamp; + struct timespec ts; + ts.tv_sec = clipbuf->tv_sec; + ts.tv_nsec = clipbuf->tv_nsec; + buf->st_atim = buf->st_mtim = ts; buf->st_size = clipbuf->len; GlobalUnlock (hglb); } -- Takashi Yano

[PATCH] Cygwin: pty: Fix master closing error regarding attach_mutex.

2021-10-08 Thread Takashi Yano
- If two or more pty masters are opened in a process, closing master causes error when closing attach_mutex. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin-developers/2021-October/012418.html --- winsup/cygwin/fhandler_tty.cc | 7 +-- winsup/cygwin/release/3.3.0

<    1   2   3   4   5   6   7   8   9   10   >