I've attached a patch that serves to silently ignore unrecognized escape 
sequences and invalid Unicode while in the line editor. This makes it much 
easier to recover from, for example, inadvertently pressing an unhandled cursor 
key while entering an expression.
Index: src/LineInput.cc
===================================================================
--- src/LineInput.cc    (revision 780)
+++ src/LineInput.cc    (working copy)
@@ -907,6 +907,9 @@
                    lec.paste();
                    continue;
 
+              case Invalid_Unicode:
+                   continue;
+
               default:  // regular APL character
                    lec.insert_char(uni);
                    continue;
@@ -1016,10 +1019,6 @@
               //
               if (ESCmap::need_more(seq, s))   continue;
 
-              CERR << endl << "Unknown ESC sequence: ESC";
-              loop(ss, s)   CERR << " " << HEX2(seq[ss + 1]);
-              CERR << endl;
-
               return Invalid_Unicode;
             }
       }

Reply via email to