[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] [PATCH] ONLCR ssh stairs effect



Hello.

When you do "stty" on FreeMiNT, you get:
-onlcr
It means that LF to CR+LF translation is disabled on output.
This is wrong, because it actually enabled (T_CRMOD internal flag).

From FreeMiNT, if you do ssh to a Linux server, you get stairs effect.
Again, this is because of the -onlcr issue.
tcgetattr() does not return ONLCR, while it should.

The attached patch fixes tcgetattr() to return ONLCR when appropriate.
It fixes both stty output and ssh stairs effect.

Alan, please commit!

onlcr.patch
Fixed tcgetattr() to return ONLCR when appropriate. Contributed by Vincent Riviere.

--
Vincent Rivière
diff -x CVS -aurN mintlib.orig/termios/tcgetattr.c mintlib/termios/tcgetattr.c
--- mintlib.orig/termios/tcgetattr.c	2002-04-24 08:54:11.000000000 +0200
+++ mintlib/termios/tcgetattr.c	2013-12-19 03:06:39.015625000 +0100
@@ -60,7 +60,7 @@
 			 ((sg.sg_flags & RAW) ? 0 : IGNPAR)) /*keep stty happy*/
 			| ((sg.sg_flags & TANDEM) ? (IXON | IXOFF) : 0)
 			| ((sg.sg_flags & RAW) ? 0 : IXON));
-  stp->c_oflag = (tcflag_t) (sg.sg_flags & RAW) ? 0 : OPOST;
+  stp->c_oflag = (tcflag_t) (sg.sg_flags & CRMOD) ? (OPOST | ONLCR) : 0;
   stp->c_cflag = (tcflag_t) (CREAD
 			| ((flags & _TF_CAR) ? 0 : CLOCAL)
 			| ((state & _TS_HPCL) ? HUPCL : 0)