Matthew Dempsky <matt...@dempsky.org> wrote:

> While reading the mosh research paper[1], I noticed we don't have
> IUTF8, which is necessary for backspace to work correctly in canonical
> mode (ICANON) with UTF-8 characters.

Here's a quick diff for stty(1).

Index: modes.c
===================================================================
RCS file: /cvs/src/bin/stty/modes.c,v
retrieving revision 1.10
diff -u -p -r1.10 modes.c
--- modes.c     27 Oct 2009 23:59:22 -0000      1.10
+++ modes.c     12 Apr 2012 13:45:33 -0000
@@ -115,6 +115,8 @@ const struct modes imodes[] = {
        { "-decctlq",   IXANY, 0 },
        { "imaxbel",    IMAXBEL, 0 },
        { "-imaxbel",   0, IMAXBEL },
+       { "iutf8",      IUTF8, 0 },
+       { "-iutf8",     0, IUTF8 },
        { NULL },
 };
 
Index: print.c
===================================================================
RCS file: /cvs/src/bin/stty/print.c,v
retrieving revision 1.13
diff -u -p -r1.13 print.c
--- print.c     27 Oct 2009 23:59:22 -0000      1.13
+++ print.c     12 Apr 2012 13:54:25 -0000
@@ -130,6 +130,7 @@ print(struct termios *tp, struct winsize
        put("-ixoff", IXOFF, 0);
        put("-ixany", IXANY, 1);
        put("-imaxbel", IMAXBEL, 1);
+       put("-iutf8", IUTF8, 0);
        put("-ignbrk", IGNBRK, 0);
        put("-brkint", BRKINT, 1);
        put("-inpck", INPCK, 0);
Index: stty.1
===================================================================
RCS file: /cvs/src/bin/stty/stty.1,v
retrieving revision 1.38
diff -u -p -r1.38 stty.1
--- stty.1      3 Sep 2011 22:59:08 -0000       1.38
+++ stty.1      12 Apr 2012 14:10:59 -0000
@@ -233,6 +233,8 @@ Otherwise, if
 .Cm imaxbel
 is unset and the input queue is full, the next input character causes
 the entire input and output queues to be discarded.
+.It Cm iutf8 Pq Fl iutf8
+Enable (disable) UTF-8 processing in canonical mode.
 .El
 .Ss Output modes
 This corresponds to the
@@ -267,7 +269,7 @@ Local mode flags (lflags) affect various
 processing.
 Historically the term "local" pertained to new job control features
 implemented by Jim Kulp on a
-.Tn Pdp 11/70
+.Tn PDP 11/70
 at
 .Tn IIASA .
 Later the driver ran on the first

-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to