Re: Terminal input processing fix (update)

2002-03-05 Thread Corinna Vinschen

On Mon, Mar 04, 2002 at 07:13:11PM +0100, Christian LESTRADE wrote:
> Here a new version of my input processing patch.

Applied.  I've just changed your ChangeLog entry slightly.

Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Terminal input processing fix (update)

2002-03-04 Thread Christian LESTRADE

Here a new version of my input processing patch.

-- winsup/cygwin/ChangeLog --

2002-03-04  Christian Lestrade  <[EMAIL PROTECTED]>

* include/sys/termios.h: define _POSIX_VDISABLE
define CCEQ macro

* fhandler_termios.cc: include 
(line_edit): Recognize disabled c_cc[] chars
Ignore VDISCARD when not in ICANON mode



termios.patch
Description: Binary data


Re: Terminal input processing fix

2002-03-01 Thread Corinna Vinschen

On Thu, Feb 28, 2002 at 09:24:40PM +0100, Christian LESTRADE wrote:
> At 18:14 25/02/02 +0100, you wrote:
> >So we could go ahead and apply your patch but... actually I would like
> >to ask you to change it.  The reason is that the _POSIX_VDISABLE
> >constant is typically defined in some header file in /usr/include.  As
> >is the functionality of CC_EQUAL which is called CCEQ, at least in Linux.
> >
> >So what I'd like you to ask is, could you tweak your patch so that these
> >macros are defined in some appropriate header files, e.g. sys/termios.h?
> 
> The _POSIX_VDISABLE and CCEQ defines doesn't (yet) exist in cygwin.
> 
> 1. _POSIX_VDISABLE belongs to a set of constants not included yet in 
> cygwin. Should I include it alone in sys/termios.h?
> 
> 2. CCEQ is only defined in Linux in a BSD context and has not quite the 
> same definition as my macro. Should I also include the CCEQ macro in 
> sys/termios.h and adapt my code to use it?

Yeah, that's what I'm asking for.  I think it has always at least a
minor advantage to have our implementation in Cygwin modelled on
something already existing.

Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Re: Terminal input processing fix

2002-02-28 Thread Christian LESTRADE

At 18:14 25/02/02 +0100, you wrote:
>So we could go ahead and apply your patch but... actually I would like
>to ask you to change it.  The reason is that the _POSIX_VDISABLE
>constant is typically defined in some header file in /usr/include.  As
>is the functionality of CC_EQUAL which is called CCEQ, at least in Linux.
>
>So what I'd like you to ask is, could you tweak your patch so that these
>macros are defined in some appropriate header files, e.g. sys/termios.h?

The _POSIX_VDISABLE and CCEQ defines doesn't (yet) exist in cygwin.

1. _POSIX_VDISABLE belongs to a set of constants not included yet in 
cygwin. Should I include it alone in sys/termios.h?

2. CCEQ is only defined in Linux in a BSD context and has not quite the 
same definition as my macro. Should I also include the CCEQ macro in 
sys/termios.h and adapt my code to use it?

Christian Lestrade




Re: Terminal input processing fix

2002-02-25 Thread Corinna Vinschen

On Fri, Jan 18, 2002 at 10:59:10PM +0100, Christian LESTRADE wrote:
> Hello,
> 
> I would like to submit the following bugfix for theses bugs which appear
> mainly when using rxvt:
> 
> * Unable to effectively disable c_cc[] input chars processing (like ^C) 
> using
>   $ stty intr '^-'
>   When I type CTRL-SPACE, I enter a NULL char which is interpreted like ^C
> 
> * In raw mode (stty -icanon), the VDISCARD key (^O) should not be 
> recognized,
>   but should be passed to the application

Hi Christian,

your assignment *finally* arrived.

So we could go ahead and apply your patch but... actually I would like
to ask you to change it.  The reason is that the _POSIX_VDISABLE
constant is typically defined in some header file in /usr/include.  As
is the functionality of CC_EQUAL which is called CCEQ, at least in Linux.

So what I'd like you to ask is, could you tweak your patch so that these
macros are defined in some appropriate header files, e.g. sys/termios.h?

I'm looking forward,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Re: Terminal input processing fix

2002-01-18 Thread Corinna Vinschen

On Fri, Jan 18, 2002 at 10:59:10PM +0100, Christian LESTRADE wrote:
> Hello,
> 
> I would like to submit the following bugfix for theses bugs which appear
> mainly when using rxvt:
> 
> * Unable to effectively disable c_cc[] input chars processing (like ^C) 
> using
>   $ stty intr '^-'
>   When I type CTRL-SPACE, I enter a NULL char which is interpreted like ^C
> 
> * In raw mode (stty -icanon), the VDISCARD key (^O) should not be 
> recognized,
>   but should be passed to the application
> 
> This fix does not prevent rxvt to hang when typing ^O in cooked mode, but 
> only
> in raw mode, instead of always.

Thanks for that patch.  It looks good, even the ChangeLog.

Unfortunately your patch has a size which already requires us to
have a signed copyright assignment form from you as described on
http://cygwin.com/contrib.html. 

Please send the signed form by snail mail.  That will take some
days but it's required.

Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Developermailto:[EMAIL PROTECTED]
Red Hat, Inc.



Terminal input processing fix

2002-01-18 Thread Christian LESTRADE

Hello,

I would like to submit the following bugfix for theses bugs which appear
mainly when using rxvt:

* Unable to effectively disable c_cc[] input chars processing (like ^C) using
   $ stty intr '^-'
   When I type CTRL-SPACE, I enter a NULL char which is interpreted like ^C

* In raw mode (stty -icanon), the VDISCARD key (^O) should not be recognized,
   but should be passed to the application

This fix does not prevent rxvt to hang when typing ^O in cooked mode, but only
in raw mode, instead of always.


Christian LESTRADE
mailto:[EMAIL PROTECTED]

-- winsup/cygwin/ChangeLog --

2002-01-18  Christian Lestrade  <[EMAIL PROTECTED]>

 * fhandler_termios.cc (CC_EQUAL): New macro
 (line_edit): Recognize disabled c_cc[] chars
 Ignore VDISCARD when not in ICANON mode

-- winsup/cygwin/fhandler_termios.cc.patch --
--- fhandler_termios.cc.origSun Aug 26 03:41:58 2001
+++ fhandler_termios.cc Tue Jan 15 11:49:04 2002
@@ -22,6 +22,18 @@
  #include "pinfo.h"
  #include "tty.h"

+/* Don't match caracters undefined with _POSIX_VDISABLE */
+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE '\0'
+#endif
+
+/* Match char a with c_cc member b */
+/* Take care: types of a (char) and b (unsigned char)
+   don't have the same scope, so don't directly compare 'a'
+   with _POSIX_VDISABLE */
+#define CC_EQUAL(a, b) \
+  (((tc->ti.c_cc[b] != _POSIX_VDISABLE) && (a == tc->ti.c_cc[b])))
+
  /* Common functions shared by tty/console */

  void
@@ -207,11 +219,11 @@
if (tc->ti.c_lflag & ISIG)
 {
   int sig;
- if (c ==  tc->ti.c_cc[VINTR])
+ if (CC_EQUAL(c, VINTR))
 sig = SIGINT;
- else if (c == tc->ti.c_cc[VQUIT])
+ else if (CC_EQUAL(c, VQUIT))
 sig = SIGQUIT;
- else if (c == tc->ti.c_cc[VSUSP])
+ else if (CC_EQUAL(c, VSUSP))
 sig = SIGTSTP;
   else
 goto not_a_sig;
@@ -226,7 +238,7 @@
  not_a_sig:
if (tc->ti.c_iflag & IXON)
 {
- if (c == tc->ti.c_cc[VSTOP])
+ if (CC_EQUAL(c, VSTOP))
 {
   if (!tc->output_stopped)
 {
@@ -235,7 +247,7 @@
 }
   continue;
 }
- else if (c == tc->ti.c_cc[VSTART])
+ else if (CC_EQUAL(c, VSTART))
 {
  restart_output:
   tc->output_stopped = 0;
@@ -245,20 +257,20 @@
   else if ((tc->ti.c_iflag & IXANY) && tc->output_stopped)
 goto restart_output;
 }
-  if (tc->ti.c_lflag & IEXTEN && c == tc->ti.c_cc[VDISCARD])
+  if (iscanon && tc->ti.c_lflag & IEXTEN && CC_EQUAL(c, VDISCARD))
 {
   tc->ti.c_lflag ^= FLUSHO;
   continue;
 }
if (!iscanon)
 /* nothing */;
-  else if (c == tc->ti.c_cc[VERASE])
+  else if (CC_EQUAL(c, VERASE))
 {
   if (eat_readahead (1))
 echo_erase ();
   continue;
 }
-  else if (c == tc->ti.c_cc[VWERASE])
+  else if (CC_EQUAL(c, VWERASE))
 {
   int ch;
   do
@@ -269,7 +281,7 @@
   while ((ch = peek_readahead (1)) >= 0 && !isspace (ch));
   continue;
 }
-  else if (c == tc->ti.c_cc[VKILL])
+  else if (CC_EQUAL(c, VKILL))
 {
   int nchars = eat_readahead (-1);
   if (tc->ti.c_lflag & ECHO)
@@ -277,7 +289,7 @@
   echo_erase (1);
   continue;
 }
-  else if (c == tc->ti.c_cc[VREPRINT])
+  else if (CC_EQUAL(c, VREPRINT))
 {
   if (tc->ti.c_lflag & ECHO)
 {
@@ -286,14 +298,14 @@
 }
   continue;
 }
-  else if (c == tc->ti.c_cc[VEOF])
+  else if (CC_EQUAL(c, VEOF))
 {
   termios_printf ("EOF");
   input_done = 1;
   continue;
 }
-  else if (c == tc->ti.c_cc[VEOL] ||
-  c == tc->ti.c_cc[VEOL2] ||
+  else if (CC_EQUAL(c, VEOL) ||
+  CC_EQUAL(c, VEOL2) ||
c == '\n')
 {
   set_input_done (1);