Re: TIOCPKT mode of PTY is broken if ONLCR bit is cleared.

2015-03-25 Thread Takashi Yano
to the changes in fhandler_tty.cc, this patch doesn't apply cleanly anymore. Any chance you could resend it (ideally to the cygwin-patches ML) diff'ed against git HEAD? Please find a revised patch attached to this mail. ChangeLog is as follows: 2015-03-25 Takashi Yano takashi.y...@nifty.ne.jp

Re: Cygwin hangs up if several keys are typed during outputting a lot of texts.

2015-04-22 Thread Takashi Yano
is as follows. 2015-04-22 Takashi Yano takashi.y...@nifty.ne.jp * fhandler.h (class fhandler_base): Add virtual function get_io_handle_cyg() to get handle from which OPOST-processed output is read on PTY master. (class fhandler_pty_slave): Add variable output_handle_cyg

[PATCH cygwin] Re: Date field of ls -l command is garbled in latest cygwin1.dll snapshot.

2018-06-23 Thread Takashi Yano
On Sat, 23 Jun 2018 08:06:59 +0900 Takashi Yano wrote: > Therefore, the script mkcategories which generates categories.t > should be fixed. I was thinking to wait for Thomas's action, but I tried to fix it myself since it seemed easy. I attach a patch to solve this problem. I hope this

Re: perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.

2018-07-03 Thread Takashi Yano
? Only the FreeBSD > > route may be the answer... > > I guess the simplest solution is to use the FreeBSD/OpenBSD method > all the time. This is for fixing psiginfo(). -- Takashi Yano 0001-Fix-a-bug-of-psiginfo-that-changes-the-orientation-o.patch Description: Binary data

Re: [PATCH cygwin] Re: Problems of AF_INET domain socket regarding out-of-band data.

2018-06-21 Thread Takashi Yano
Sorry, again. Fix a typo in commit message. -- Takashi Yano 0001-Fix-the-handling-of-out-of-band-OOB-data-in-a-socket.patch Description: Binary data

[PATCH cygwin] Re: Problems of AF_INET domain socket regarding out-of-band data.

2018-06-21 Thread Takashi Yano
ing from AF_LOCAL socket. Please find a new patch attached. -- Takashi Yano 0001-Fix-the-handling-of-out-band-data-OOB-in-a-socket.patch Description: Binary data

Re: [PATCH cygwin] Re: Problems of AF_INET domain socket regarding out-of-band data.

2018-06-21 Thread Takashi Yano
On Fri, 22 Jun 2018 00:05:18 +0900 Takashi Yano wrote: > Sorry, again. Fix a typo in commit message. Fix a typo in commit message again -- Takashi Yano 0001-Fix-the-handling-of-out-of-band-OOB-data-in-a-socket.patch Description: Binary data

Re: Why /dev/kmsg was deleted from cygwin1.dll in git?

2018-07-05 Thread Takashi Yano
attached. In this patch, get_inet_addr_local() is used instead of getsockname() as in the past. I will appreciate any comments. -- Takashi Yano 0001-Fix-a-problem-that-connection-to-syslogd-fails.patch Description: Binary data

Re: Why /dev/kmsg was deleted from cygwin1.dll in git?

2018-07-04 Thread Takashi Yano
Hi Corinna, On Wed, 4 Jul 2018 12:54:20 +0200 Corinna Vinschen wrote: > On Jul 4 04:44, Takashi Yano wrote: > > Why was /dev/kmsg deleted from cygwin1.dll in git? > > Due to this change, syslogd in inetutils package no longer works. > > /dev/kmsg doesn't really give a

Re: Why /dev/kmsg was deleted from cygwin1.dll in git?

2018-07-05 Thread Takashi Yano
posted. Moreover, syslog-ng does not remove /dev/log even after exiting normally. This means my first patch removing the code may cause the problem below. On Fri, 6 Jul 2018 00:29:24 +0900 Takashi Yano wrote: > On Wed, 4 Jul 2018 16:52:47 +0200 > Corinna Vinschen wrote: > > What the cod

[PATCH 1/1] Cygwin: console: fix key input for native console application

2019-04-03 Thread Takashi Yano
- After 24 bit color support patch, arrow keys and function keys do not work properly in native console applications if they are started in cygwin console. This patch fixes this issue. --- winsup/cygwin/fhandler_console.cc | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH 0/1] Fix console again (Re: Pseudo console support in PTY)

2019-04-03 Thread Takashi Yano
wrong. The conpty stuff *is* only applied for ptys. > > The above appears to be a fallout of the console changes to support > the Windows console changes to emulate an xterm-256color, > https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=bd627864ab41 > > Takashi, can

Re: [PATCH fifo 2/2] Cygwin: FIFO: add support for the duplex case

2019-03-30 Thread Takashi Yano
ror ()) > + { > + case ERROR_NO_DATA: > + break; > + case ERROR_PIPE_LISTENING: > + if (_duplexer && i == 0) > + break; > + /* Fall through. */ > + default: > + fifo_client_unlock (); > + goto errout; > + } > + else if (nread == 0 && (!_duplexer || i > 0)) > + /* Client has disconnected. */ > { > client[i].state = fc_invalid; > nconnected--; > -- > 2.17.0 > -- Takashi Yano

[PATCH] Reworks for console code

2019-03-31 Thread Takashi Yano
in current cygwin. -- Takashi Yano 0001-Cygwin-console-support-24-bit-color.patch Description: Binary data 0002-Cygwin-console-fix-select-behaviour.patch Description: Binary data 0003-Cygwin-console-Make-I-O-functions-thread-safe.patch Description: Binary data #include #include #include

[PATCH v3 2/3] Cygwin: console: fix select() behaviour

2019-03-31 Thread Takashi Yano
- Previously, select() would return when only one key is typed even in canonical mode. With this patch, it returns after one line is completed. --- winsup/cygwin/fhandler.h | 12 +- winsup/cygwin/fhandler_console.cc | 794 -- winsup/cygwin/select.cc

[PATCH v3 0/3] Reworks for console code

2019-03-31 Thread Takashi Yano
rec.Event.KeyEvent.wVirtualKeyCode == VK_SPACE > + else if (input_rec.Event.KeyEvent.wVirtualKeyCode > +== (wincap.has_con_24bit_colors () ? '2' : VK_SPACE) > && (ctrl_key_state & CTRL_PRESSED) > && !(ctrl_key_state & ALT_P

[PATCH v3 3/3] Cygwin: console: Make I/O functions thread-safe

2019-03-31 Thread Takashi Yano
- POSIX states I/O functions shall be thread-safe, however, cygwin console I/O functions were not. This patch makes console I/O functions thread-safe. --- winsup/cygwin/fhandler.h | 18 +++- winsup/cygwin/fhandler_console.cc | 136 +-

[PATCH v3 1/3] Cygwin: console: support 24 bit color

2019-03-31 Thread Takashi Yano
- Add 24 bit color support using xterm compatibility mode in Windows 10 1703 or later. - Add fake 24 bit color support for legacy console, which uses the nearest color from 16 system colors. --- winsup/cygwin/environ.cc | 7 +- winsup/cygwin/fhandler.h | 4 +

[PATCH v2 3/3] Cygwin: console: Make I/O functions thread-safe

2019-03-31 Thread Takashi Yano
- POSIX states I/O functions shall be thread-safe, however, cygwin console I/O functions were not. This patch makes console I/O functions thread-safe. --- winsup/cygwin/fhandler.h | 18 +++- winsup/cygwin/fhandler_console.cc | 136 +-

[PATCH v2 0/3] Reworks for console code

2019-03-31 Thread Takashi Yano
Hi Corinna, I have revised the patches according to your advice. Could you please have a look? Takashi Yano (3): Cygwin: console: support 24 bit color Cygwin: console: fix select() behaviour Cygwin: console: Make I/O functions thread-safe winsup/cygwin/environ.cc |7

[PATCH v2 2/3] Cygwin: console: fix select() behaviour

2019-03-31 Thread Takashi Yano
- Previously, select() would return when only one key is typed even in canonical mode. With this patch, it returns after one line is completed. --- winsup/cygwin/fhandler.h | 12 +- winsup/cygwin/fhandler_console.cc | 794 -- winsup/cygwin/select.cc

[PATCH v2 1/3] Cygwin: console: support 24 bit color

2019-03-31 Thread Takashi Yano
- Add 24 bit color support using xterm compatibility mode in Windows 10 1703 or later. - Add fake 24 bit color support for legacy console, which uses the nearest color from 16 system colors. --- winsup/cygwin/environ.cc | 7 +- winsup/cygwin/fhandler.h | 4 +

[PATCH 1/1] Cygwin: console: Fix cursor position restore after screen alternation.

2019-08-12 Thread Takashi Yano
- If screen is alternated on console, cursor position is not restored correctly in the case of xterm compatible mode is enabled. For example, the shell prompt is shown at incorrect position after using vim. This patch fixes this problem. --- winsup/cygwin/fhandler_console.cc | 3 +++ 1 file

[PATCH 0/1] Fix cursor position restoration on console

2019-08-12 Thread Takashi Yano
In cygwin test release 3.1.0-0.1, the cursor position is not restored correctly after screen alternation in the case of xterm compatible mode is enabled. For example, the shell prompt is shown at incorrect position after using vim. This patch fixes this problem. Takashi Yano (1): Cygwin

[PATCH 0/1] Workaround for bug of hrizontal tab on console.

2019-08-12 Thread Takashi Yano
In cygwin test release 3.1.0-0.1, the horizontal tab setting is broken after resizing console window. This seems to be a bug of xterm compatible mode of windows console. This patch fixes this problem. Takashi Yano (1): Cygwin: console: Add workaround for windows xterm compatible mode bug

[PATCH 1/1] Cygwin: console: Add workaround for windows xterm compatible mode bug.

2019-08-12 Thread Takashi Yano
- The horizontal tab positions are broken after resizing console window. This seems to be a bug of xterm compatible mode of windows console. This workaround fixes this problem. --- winsup/cygwin/fhandler_console.cc | 19 +++ 1 file changed, 19 insertions(+) diff --git

[PATCH 0/1] Fix deadlock at calling fork() in console

2019-08-12 Thread Takashi Yano
In cygwin test release 3.1.0-0.1, calling fork on console ocasionally falls into deadlock. The reason is not clear, however, this patch fixes this problem anyway. Takashi Yano (1): Cygwin: console: Fix deadlock at calling fork(). winsup/cygwin/fhandler_console.cc | 8 ++-- 1 file changed

[PATCH 1/1] Cygwin: console: Fix deadlock at calling fork().

2019-08-12 Thread Takashi Yano
- Calling fork() on console occasionally falls into deadlock. The reason is not clear, however, this patch fixes this problem anyway. --- winsup/cygwin/fhandler_console.cc | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc

[PATCH 0/1] Fix select() regarding SIGWINCH in console

2019-08-14 Thread Takashi Yano
SIGWINCH is ignored. This patch adds code so that select() is not interrupted by SIGWINCH when it is ignored (SIG_IGN or SIG_DFL). Takashi Yano (1): Cygwin: console: Fix the condition to interrupt select() by SIGWINCH winsup/cygwin/select.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH 1/1] Cygwin: console: Fix workaround for horizontal tab position

2019-08-14 Thread Takashi Yano
- The workaround commit 33a21904a702191cebf0e81b4deba2dfa10a406c does not work as expected if window size is changed while screen is alternated. Fixed. --- winsup/cygwin/fhandler_console.cc | 47 +++ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git

[PATCH 1/1] Cygwin: console: Fix the condition to interrupt select() by SIGWINCH

2019-08-14 Thread Takashi Yano
- Add code so that select() is not interrupted by SIGWINCH if it is ignored (SIG_IGN or SIG_DFL). --- winsup/cygwin/select.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 9cf892801..4e9256b9f 100644 ---

[PATCH 0/1] Workaround for horizontal tab on console (again)

2019-08-14 Thread Takashi Yano
The workaround commit 33a21904a702191cebf0e81b4deba2dfa10a406c does not work as expected if the window size is changed while screen is alternated. This patch fixes the issue. Takashi Yano (1): Cygwin: console: Fix workaround for horizontal tab position winsup/cygwin/fhandler_console.cc | 47

[PATCH 0/1] Fix PTY state management in pseudo console support.

2019-08-31 Thread Takashi Yano
by redesigning the state management. Takashi Yano (1): Cygwin: pty: Fix state management for pseudo console support. winsup/cygwin/dtable.cc | 15 +- winsup/cygwin/fhandler.h | 6 +- winsup/cygwin/fhandler_console.cc | 6 +- winsup/cygwin/fhandler_tty.cc | 401

[PATCH 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-08-31 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 has some bugs which cause mismatch between state variables and real pseudo console state regarding console attaching and r/w pipe switching. This patch fixes this issue by redesigning the state

Re: [PATCH v4 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-09-02 Thread Takashi Yano
on? Calling __loadlocale() here causes execution error. mintty: 0 [main] tcsh 1901 sig_send: error sending signal 6, pid 1901, pipe handle 0x0, nb 0, packsize 164, Win32 error 6 script: Script started, file is typescript script: failed to execute /bin/tcsh: Bad address Script done, file is t

[PATCH v5 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-09-03 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 has some bugs which cause mismatch between state variables and real pseudo console state regarding console attaching and r/w pipe switching. This patch fixes this issue by redesigning the state

[PATCH 0/2] Some fixes for PTY with pseudo console support (2)

2019-09-03 Thread Takashi Yano
sequences. Therefore, clear screen is disabled on these screens. Takashi Yano (2): Cygwin: pty: Add a workaround for ^C handling. Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*. winsup/cygwin/fhandler_tty.cc | 31 --- winsup/cygwin/spawn.cc

[PATCH 1/2] Cygwin: pty: Add a workaround for ^C handling.

2019-09-03 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random crash or freeze by pressing ^C while cygwin and non-cygwin processes are executed simultaneously in the same pty. This patch is a workaround for this issue. ---

[PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-03 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 shows garbage ^[[H^[[J in some of emacs screens. These screens do not handle ANSI escape sequences. Therefore, clear screen is disabled on these screens. --- winsup/cygwin/fhandler_tty.cc | 26

[PATCH v5 0/1] Fix PTY state management in pseudo console support.

2019-09-03 Thread Takashi Yano
by redesigning the state management. v5: Revise based on https://cygwin.com/ml/cygwin-patches/2019-q3/msg00111.html v4: Small bug fix again. v3: Fix the first issue (Bad file descriptor) reported in https://cygwin.com/ml/cygwin-patches/2019-q3/msg00104.html v2: Small bug fixed from v1. Takashi

[PATCH 4/4] Cygwin: pty: Limit API hook to the program linked with the APIs.

2019-09-03 Thread Takashi Yano
- API hook used for pseudo console support causes slow down. This patch limits API hook to only program which is linked with the corresponding APIs. Normal cygwin program is not linked with such APIs (such as WriteFile, etc...) directly, therefore, no slow down occurs. However, console

[PATCH 3/4] Cygwin: pty: Move function hook_api() into hookapi.cc.

2019-09-03 Thread Takashi Yano
- PTY uses Win32 API hook for pseudo console suppot. The function hook_api() is used for this purpose and defined in fhandler_tty.cc previously. This patch moves it into hookapi.cc. --- winsup/cygwin/fhandler_tty.cc | 44 --- winsup/cygwin/hookapi.cc | 34

[PATCH 1/4] Cygwin: pty: Code cleanup

2019-09-03 Thread Takashi Yano
- Cleanup the code which is commented out by #if 0 regarding pseudo console. - Remove #if 1 for experimental code which seems to be stable. --- winsup/cygwin/fhandler_tty.cc | 28 1 file changed, 28 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH 2/4] Cygwin: pty: Speed up a little hooked Win32 API for pseudo console.

2019-09-03 Thread Takashi Yano
- Some Win32 APIs are hooked in pty code for pseudo console support. This causes slow down. This patch improves speed a little. --- winsup/cygwin/fhandler_tty.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc

[PATCH 0/4] Some fixes for PTY with pseudo console support (1)

2019-09-03 Thread Takashi Yano
and strace.cc. Takashi Yano (4): Cygwin: pty: Code cleanup Cygwin: pty: Speed up a little hooked Win32 API for pseudo console. Cygwin: pty: Move function hook_api() into hookapi.cc. Cygwin: pty: Limit API hook to the program linked with the APIs. winsup/cygwin/fhandler_tty.cc | 136

Re: [PATCH v4 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-09-03 Thread Takashi Yano
d with corresponding APIs. However, this strategy does not have the effect for console access by cygwin1.dll itself. So, to switch r/w pipe to pseudo console side, I added the code in strace.cc and smallprint.cc. Could you please have a look? -- Takashi Yano

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-03 Thread Takashi Yano
Hi Brian, On Tue, 3 Sep 2019 20:47:14 -0600 Brian Inglis wrote: > On 2019-09-03 19:46, Takashi Yano wrote: > > - Pseudo console support introduced by commit > > 169d65a5774acc76ce3f3feeedcbae7405aa9b57 shows garbage ^[[H^[[J in > > some of emacs screens. These scree

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-03 Thread Takashi Yano
On Wed, 4 Sep 2019 12:34:31 +0900 Takashi Yano wrote: > Attached is the raw output from pseudo console when the screen shows > the simple text below. > > from here > [yano@Express5800-S70 ~]$ cmd > Microsoft Windows [Version 10.0.18362.329] > (c) 2019 Microsoft Co

[PATCH v3 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-09-01 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 has some bugs which cause mismatch between state variables and real pseudo console state regarding console attaching and r/w pipe switching. This patch fixes this issue by redesigning the state

[PATCH v3 0/1] Fix PTY state management in pseudo console support.

2019-09-01 Thread Takashi Yano
by redesigning the state management. v3: Fix the first issue (Bad file descriptor) reported in https://cygwin.com/ml/cygwin-patches/2019-q3/msg00104.html v2: Small bug fixed from v1. Takashi Yano (1): Cygwin: pty: Fix state management for pseudo console support. winsup/cygwin/dtable.cc

[PATCH v4 0/1] Fix PTY state management in pseudo console support.

2019-09-01 Thread Takashi Yano
by redesigning the state management. v4: Small bug fix again. v3: Fix the first issue (Bad file descriptor) reported in https://cygwin.com/ml/cygwin-patches/2019-q3/msg00104.html v2: Small bug fixed from v1. Takashi Yano (1): Cygwin: pty: Fix state management for pseudo console support. winsup

[PATCH v4 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-09-01 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 has some bugs which cause mismatch between state variables and real pseudo console state regarding console attaching and r/w pipe switching. This patch fixes this issue by redesigning the state

Re: [PATCH v2 0/1] Fix PTY state management in pseudo console support.

2019-09-01 Thread Takashi Yano
Hi Ken, Thank you for testing. On Sun, 1 Sep 2019 15:13:47 + Ken Brown wrote: > On 8/31/2019 6:54 PM, Takashi Yano wrote: > > Pseudo console support in test release TEST: Cygwin 3.1.0-0.3, > > introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57, > > has

[PATCH v2 1/1] Cygwin: pty: Fix state management for pseudo console support.

2019-08-31 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 has some bugs which cause mismatch between state variables and real pseudo console state regarding console attaching and r/w pipe switching. This patch fixes this issue by redesigning the state

[PATCH v2 0/1] Fix PTY state management in pseudo console support.

2019-08-31 Thread Takashi Yano
by redesigning the state management. v2: Small bug fixed from v1. Takashi Yano (1): Cygwin: pty: Fix state management for pseudo console support. winsup/cygwin/dtable.cc | 15 +- winsup/cygwin/fhandler.h | 6 +- winsup/cygwin/fhandler_console.cc | 6 +- winsup/cygwin

Re: [PATCH 0/1] Fix PTY state management in pseudo console support.

2019-08-31 Thread Takashi Yano
This patch has a small bug. Please use v2 instead. On Sat, 31 Aug 2019 23:53:17 +0900 Takashi Yano wrote: > Pseudo console support in test release TEST: Cygwin 3.1.0-0.3, > introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57, > has some bugs which cause mismatch betw

[PATCH 0/1] Cygwin: pty: Make it sure to show up system error messages.

2019-09-05 Thread Takashi Yano
it is necessary to change console attached. Takashi Yano (1): Cygwin: pty: Make it sure to show up system error messages. winsup/cygwin/fhandler_tty.cc | 55 +++ 1 file changed, 49 insertions(+), 6 deletions(-) -- 2.21.0

[PATCH 1/1] Cygwin: pty: Make it sure to show up system error messages.

2019-09-05 Thread Takashi Yano
- Forcibly attach to pseudo console in advance so that the error messages by system_printf() is displayed to screen reliably. This is needed when stdout is redirected to another pty. In this case, process has two ptys opened. However, process can attach to only one console. So it is

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
erm && strcmp (term, "dumb") && > + term && !strstr (term, "emacs") && > + !ALWAYS_USE_PCON) > > You're checking term for != NULL twice. Oh my! -- Takashi Yano

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
hich in turn requires to change > the behaviour again. But yeah, this sound like the first patch is not > actually required at all. I was convinced. I will revise the patch. -- Takashi Yano

Re: [PATCH 4/4] Cygwin: pty: Limit API hook to the program linked with the APIs.

2019-09-04 Thread Takashi Yano
e it inline, a lot of changes will be necessary. How about non-inline function? -- Takashi Yano

Re: [PATCH 1/2] Cygwin: pty: Add a workaround for ^C handling.

2019-09-04 Thread Takashi Yano
ixup_after_attach (!iscygwin ()); + if (!iscygwin ()) + { + init_console_handler (myself->ctty > 0); + myself->ctty = 0; + } + loop: /* When ruid != euid we create the new process under the current original account and impersonate in child, this way maintaining the different -- Takashi Yano

[PATCH v2 1/1] Cygwin: pty: Add a workaround for ^C handling.

2019-09-04 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 sometimes cause random crash or freeze by pressing ^C while cygwin and non-cygwin processes are executed simultaneously in the same pty. This patch is a workaround for this issue. ---

[PATCH v2 1/1] Cygwin: pty: Limit API hook to the program linked with the APIs.

2019-09-04 Thread Takashi Yano
- API hook used for pseudo console support causes slow down. This patch limits API hook to only program which is linked with the corresponding APIs. Normal cygwin program is not linked with such APIs (such as WriteFile, etc...) directly, therefore, no slow down occurs. However, console

[PATCH v2 0/1] Cygwin: pty: Limit API hook to the program linked with the APIs.

2019-09-04 Thread Takashi Yano
functionality. Takashi Yano (1): Cygwin: pty: Limit API hook to the program linked with the APIs. winsup/cygwin/fhandler_tty.cc | 106 +++--- winsup/cygwin/smallprint.cc | 2 + winsup/cygwin/strace.cc | 26 + winsup/cygwin/winsup.h| 3 + 4 files

[PATCH v2 0/1] Cygwin: pty: Add a workaround for ^C handling.

2019-09-04 Thread Takashi Yano
of pty and console identical. Takashi Yano (1): Cygwin: pty: Add a workaround for ^C handling. winsup/cygwin/fork.cc | 1 - winsup/cygwin/spawn.cc | 6 ++ 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.21.0

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
value of the terminal in which emacs is executed. The first check is just in case. -- Takashi Yano

[PATCH 0/1] Cygwin: pty: Fix select() with pseudo console support.

2019-09-04 Thread Takashi Yano
- select() did not work correctly when both read and except are polled simultaneously for the same fd and the r/w pipe is switched to pseudo console side. This patch fixes this isseu. Takashi Yano (1): Cygwin: pty: Fix select() with pseudo console support. winsup/cygwin/fhandler.h

[PATCH 1/1] Cygwin: pty: Fix select() with pseudo console support.

2019-09-04 Thread Takashi Yano
- select() did not work correctly when both read and except are polled simultaneously for the same fd and the r/w pipe is switched to pseudo console side. This patch fixes this isseu. --- winsup/cygwin/fhandler.h | 15 +++ winsup/cygwin/fhandler_tty.cc | 13 ++- winsup/cygwin/select.cc

[PATCH v2 1/1] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
- Pseudo console support introduced by commit 169d65a5774acc76ce3f3feeedcbae7405aa9b57 shows garbage ^[[H^[[J in some of emacs screens. These screens do not handle ANSI escape sequences. Therefore, clear screen is disabled on these screens. --- winsup/cygwin/fhandler_tty.cc | 19

[PATCH v2 0/1] Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
(). Takashi Yano (1): Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*. winsup/cygwin/fhandler_tty.cc | 19 ++- winsup/cygwin/tty.cc | 1 + winsup/cygwin/tty.h | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) -- 2.21.0

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.

2019-09-04 Thread Takashi Yano
SI escape sequences. Indeed, the output of the pseudo console by the program above is: ^[[?25l^[[11;21H^[[?25h^[[?25l^[[31mR^[[32mG^[[34mB^[[mW^M ^[[?25h -- Takashi Yano pcon-output-dumb.log Description: Binary data

[PATCH 1/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-06 Thread Takashi Yano
- When the I/O pipe is switched to the pseudo console side, the behaviour of Ctrl-C is unstable. This rarely happens, however, for example, shell sometimes crashes by Ctrl-C in that situation. This patch fixes that issue. --- winsup/cygwin/fhandler.h | 4 +-

[PATCH 0/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-06 Thread Takashi Yano
- When the I/O pipe is switched to the pseudo console side, the behaviour of Ctrl-C is unstable. This rarely happens, however, for example, shell sometimes crashes by Ctrl-C in that situation. This patch fixes that issue. Takashi Yano (1): Cygwin: pty: Fix the behaviour of Ctrl-C

[PATCH 1/1] Cygwin: pty: Make SetConsoleCursorPosition() to be hooked.

2019-09-06 Thread Takashi Yano
- Win32 API SetConsoleCursorPosition() injects ANSI escape sequence to pseudo console. Therefore, it should be added to the API list to be hooked. --- winsup/cygwin/fhandler_tty.cc | 9 + 1 file changed, 9 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc

[PATCH 0/1] Cygwin: pty: Make SetConsoleCursorPosition() to be hooked.

2019-09-06 Thread Takashi Yano
- Win32 API SetConsoleCursorPosition() injects ANSI escape sequence to pseudo console. Therefore, it should be added to the API list to be hooked. Takashi Yano (1): Cygwin: pty: Make SetConsoleCursorPosition() to be hooked. winsup/cygwin/fhandler_tty.cc | 9 + 1 file changed, 9

[PATCH 0/1] Cygwin: pty: Prevent the helper process from exiting by Ctrl-C.

2019-09-09 Thread Takashi Yano
The helper process cygwin-console-helper.exe exsited by Ctrl-C in some situation. This patch fixes this issue. Takashi Yano (1): Cygwin: pty: Prevent the helper process from exiting by Ctrl-C. winsup/utils/cygwin-console-helper.cc | 1 + 1 file changed, 1 insertion(+) -- 2.21.0

[PATCH 1/1] Cygwin: pty: Prevent the helper process from exiting by Ctrl-C.

2019-09-09 Thread Takashi Yano
--- winsup/utils/cygwin-console-helper.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/utils/cygwin-console-helper.cc b/winsup/utils/cygwin-console-helper.cc index ad451ecf5..66004bd15 100644 --- a/winsup/utils/cygwin-console-helper.cc +++ b/winsup/utils/cygwin-console-helper.cc @@

[PATCH 0/3] Some fixes for PTY with pseudo console support (3)

2019-09-14 Thread Takashi Yano
() because it seems not too early even at this timing. Takashi Yano (3): Cygwin: pty: Fix bad file descriptor error in some environment. Cygwin: pty: Use system NLS function instead of PTY's own one. Cygwin: pty: Change the timing of clearing screen. winsup/cygwin/fhandler.h | 1 + winsup

[PATCH 2/3] Cygwin: pty: Use system NLS function instead of PTY's own one.

2019-09-14 Thread Takashi Yano
- Since calling system __loadlocale() caused execution error, PTY used its own NLS function. The cause of the error has been found, the corresponding code has been rewritten using system function. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_tty.cc | 499

[PATCH 1/3] Cygwin: pty: Fix bad file descriptor error in some environment.

2019-09-14 Thread Takashi Yano
- The bad file descriptor problem reported in: https://cygwin.com/ml/cygwin-patches/2019-q3/msg00104.html was recurring. Fixed again. --- winsup/cygwin/fhandler_tty.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index

[PATCH 3/3] Cygwin: pty: Change the timing of clearing screen.

2019-09-14 Thread Takashi Yano
- The code which clears screen is moved from reset_switch_to_pcon() to fixup_after_exec() because it seems not too early even at this timing. --- winsup/cygwin/fhandler_tty.cc | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

Re: [PATCH v3 0/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-14 Thread Takashi Yano
nal fixes have been settled with these patches, so I think it is ready to issue a new test release. -- Takashi Yano

[PATCH] Cygwin: pty: Correct typos that do not fit the coding style.

2019-09-14 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 5c27510be..5072c6243 100644 --- a/winsup/cygwin/fhandler_tty.cc +++

[PATCH] Cygwin: pty: Use autoload feature for pseudo console system calls.

2019-09-15 Thread Takashi Yano
- The autoload feature is used rather than GetModuleHandle(), GetProcAddress() for CreatePseudoConsole(), ResizePseudoConsole() and ClosePseudoConsole(). --- winsup/cygwin/autoload.cc | 3 +++ winsup/cygwin/fhandler_tty.cc | 36 +-- 2 files changed, 16

Re: [PATCH v3 0/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-06 Thread Takashi Yano
idn't get > cleared. Are you using non-cygwin program in the script? If so, this may happen in test release 3.1.0-0.4 as well. > P.S. I'm leaving tomorrow for a short vacation, so I might not have time to > review any more patches until I return in about a week. I see. So I have at le

[PATCH v4 0/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-06 Thread Takashi Yano
-patches/2019-q3/msg00175.html v3: Fix mistake in v2. v2: Remove the code which accidentally clears ENABLE_ECHO_INPUT flag. Takashi Yano (1): Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode. winsup/cygwin/fhandler.h | 4 winsup/cygwin/fhandler_tty.cc | 33

[PATCH v4 1/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-06 Thread Takashi Yano
- When the I/O pipe is switched to the pseudo console side, the behaviour of Ctrl-C is unstable. This rarely happens, however, for example, shell sometimes crashes by Ctrl-C in that situation. This patch fixes that issue. --- winsup/cygwin/fhandler.h | 4

Re: [PATCH v3 0/1] Cygwin: pty: Fix the behaviour of Ctrl-C in the pseudo console mode.

2019-09-07 Thread Takashi Yano
On Sat, 7 Sep 2019 12:20:15 +0900 Takashi Yano wrote: > On Fri, 6 Sep 2019 17:59:02 + > Ken Brown wrote: > > 3. I used ssh from my normal account to log into an administrator account. > > I > > ran a script that produced a lot of output and piped it to less. I pre

[PATCH 5/5] Cygwin: pty: Add missing guard when PTY is in the legacy mode.

2019-09-18 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 2a92e44cf..1095c82eb 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -87,7 +87,8 @@

[PATCH 2/5] Cygwin: pty: Make GDB work again on pty.

2019-09-18 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 35 +++ 1 file changed, 35 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 2a1c34f7d..843807aab 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@

[PATCH] Cygwin: console: Make console input work in GDB and strace.

2019-09-18 Thread Takashi Yano
- After commit 2232498c712acc97a38fdc297cbe53ba74d0ec2c, console input cause error in GDB or strace. This patch fixes this issue. --- winsup/cygwin/fhandler_termios.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_termios.cc

[PATCH 1/5] Cygwin: pty: Avoid potential segfault in PTY code when ppid = 1.

2019-09-18 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 659e7b595..2a1c34f7d 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -137,9

[PATCH 0/5] Some fixes for PTY with pseudo console support (4)

2019-09-18 Thread Takashi Yano
Takashi Yano (5): Cygwin: pty: Avoid potential segfault in PTY code when ppid = 1. Cygwin: pty: Make GDB work again on pty. Cygwin: pty: Unify the charset conversion codes into a function. Cygwin: pty: Add charset conversion for console apps in legacy PTY. Cygwin: pty: Add missing guard

[PATCH] Cygwin: console: Revive Win7 compatibility.

2019-09-18 Thread Takashi Yano
- The commit fca4cda7a420d7b15ac217d008527e029d05758e broke Win7 compatibility. This patch fixes the issue. --- winsup/cygwin/fhandler_console.cc | 10 +- winsup/cygwin/select.cc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 4/5] Cygwin: pty: Add charset conversion for console apps in legacy PTY.

2019-09-18 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index f723ec7cf..2a92e44cf 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -3054,6 +3054,12 @@

[PATCH 3/5] Cygwin: pty: Unify the charset conversion codes into a function.

2019-09-18 Thread Takashi Yano
--- winsup/cygwin/fhandler_tty.cc | 130 +- 1 file changed, 49 insertions(+), 81 deletions(-) diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 843807aab..f723ec7cf 100644 --- a/winsup/cygwin/fhandler_tty.cc +++

[PATCH v2 1/1] Cygwin: console: Revive Win7 compatibility.

2019-09-18 Thread Takashi Yano
- The commit fca4cda7a420d7b15ac217d008527e029d05758e broke Win7 compatibility. This patch fixes the issue. --- winsup/cygwin/fhandler.h | 6 ++ winsup/cygwin/fhandler_console.cc | 6 -- winsup/cygwin/select.cc | 1 - 3 files changed, 6 insertions(+), 7 deletions(-)

Re: [PATCH] Cygwin: console: Revive Win7 compatibility.

2019-09-18 Thread Takashi Yano
On Wed, 18 Sep 2019 18:21:49 +0200 Achim Gratz wrote: > Takashi Yano writes: > > - The commit fca4cda7a420d7b15ac217d008527e029d05758e broke Win7 > > compatibility. This patch fixes the issue. > > --- > > winsup/cygwin/fhandler_console.cc | 10 +- &

[PATCH v2 0/1] Cygwin: console: Revive Win7 compatibility.

2019-09-18 Thread Takashi Yano
- The commit fca4cda7a420d7b15ac217d008527e029d05758e broke Win7 compatibility. This patch fixes the issue. v2: Move definition of INREC_SIZE into fhandler.h from fhandler_console.cc and select.cc. Takashi Yano (1): Cygwin: console: Revive Win7 compatibility. winsup/cygwin/fhandler.h

  1   2   3   4   5   6   7   8   9   >