changeset 109612:b7ff82b433d8

Enable ICANON (Bug#6771). Any long line problem must be solved differently. There is AFAIK no bug report or test case for the long line problem. * sysdep.c (child_setup_tty): Enable ICANON in lflags and set VEOF to Control-D (Bug#6771).
author Jan D. <jan.h.d@swipnet.se>
date Mon, 02 Aug 2010 09:03:12 +0200
parents 85cbdb81d0e0
children faf7d069c517
files src/ChangeLog src/sysdep.c
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Aug 02 08:42:03 2010 +0200
+++ b/src/ChangeLog	Mon Aug 02 09:03:12 2010 +0200
@@ -1,3 +1,8 @@
+2010-08-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* sysdep.c (child_setup_tty): Enable ICANON in lflags and set VEOF
+	to Control-D (Bug#6771).
+
 2010-08-02  Juanma Barranquero  <lekktu@gmail.com>
 
 	* editfns.c (Fregion_beginning, Fregion_end): Doc fixes (bug#6493).
--- a/src/sysdep.c	Mon Aug 02 08:42:03 2010 +0200
+++ b/src/sysdep.c	Mon Aug 02 09:03:12 2010 +0200
@@ -511,7 +511,16 @@
      process.c:send_process, and instead we disable ICANON by default,
      so if a subsprocess sets up ICANON, it's his problem (or the Elisp
      package that talks to it) to deal with lines that are too long.  */
-  s.main.c_lflag &= ~ICANON;	/* Disable line editing and eof processing */
+  /* There is no more "send eof to flush" going on (which is wrong and
+     unportable in itself), and disabling ICANON breaks a lot of stuff
+     and shows literal ^D in many cases.  The correct way to handle too
+     much output is to buffer what could not be written and then write it
+     again when select returns ok for writing.  This has it own set of
+     problems. Write is now asynchronous, is that a problem?
+     How much do we buffer, and what do we do when that limit is reached?  */
+
+  s.main.c_lflag |= ICANON;	/* Enable line editing and eof processing */
+  s.main.c_cc[VEOF] = 'D'&037;	/* Control-D */
   s.main.c_cc[VMIN] = 1;
   s.main.c_cc[VTIME] = 0;