TIOCPKT mode of PTY is broken if ONLCR bit is cleared.
Takashi Yano
takashi.yano@nifty.ne.jp
Wed Mar 25 11:42:00 GMT 2015
Dear cygwin developers,
Regarding this (http://cygwin.com/ml/cygwin/2015-02/msg00929.html)
problem, I made a patch attached.
I have posted the patch to this ML with Corinna's directions.
On Mon, 23 Mar 2015 11:08:23 +0100
Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> However, due 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.yano@nifty.ne.jp>
* tty.h (class tty_min): Remove variable "write_error" to which any
errors are not currently set at anywhere.
(class tty): Add variable "column" for handling ONOCR.
* tty.cc (tty::init): Add initialization code for variable "column".
* fhandler.h (class fhandler_pty_master): Remove variable "need_nl"
which is not necessary any more. "need_nl" was needed by OPOST process
in fhandler_pty_master::process_slave_output().
(class fhandler_pty_common): Add function process_opost_output() for
handling post processing for OPOST in write process.
* fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count
TIOCPKT control byte into length to be read in TIOCPKT mode. Move
post processing for OPOST to write process. Remove code related to
variable "write_error". Return with EIO error if slave is already
closed.
(fhandler_pty_master::fhandler_pty_master): Remove initialization
code for variable "need_nl".
(fhandler_pty_common::process_opost_output): Add this function for
handling of OPOST in write process. Add code to avoid blocking in
non-blocking mode when output is suspended by ^S.
(fhandler_pty_slave::write): Call fhandler_pty_common::
process_opost_output() instead of WriteFile(). Remove code related to
variable "write_error".
(fhandler_pty_master::doecho): Call fhandler_pty_common::
process_opost_output() instead of WriteFile().
* select.cc (peek_pipe): Remove code related to variable "need_nl".
Best regards,
Takashi Yano
--
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygwin.patch.20150325
Type: application/octet-stream
Size: 10271 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20150325/9e23b917/attachment.obj>
More information about the Cygwin-patches
mailing list