Commits

Tony Sloane committed 8e171fe

Clarify JLine bug workaround comment

  • Participants
  • Parent commits 158a3e1

Comments (0)

Files changed (1)

File ScalaWorksheet.py

         return self.prefixedWith (line, self.contPrompt ())
 
     # This is a hack. A "feature" of JLine causes it to add space-CR pairs of characters
-    # at column 80 of prompt lines which causes the rest of the line to be split onto
-    # following lines, thereby messing up the output processing. After extensive
-    # exploration I can't see a way to turn this off since the width of 80 is the default
-    # if no terminal is being used. So for now, we process the output using this function
-    # to remove those extra characters before we do the rest of the processing. There is
-    # a remote chance that a real prompt line will have a space-CR in that spot so we
-    # will mess that one up.
+    # at column 80 of prompt lines. The extra CRs cause the rest of the line to be split
+    # onto following lines, thereby messing up the output processing. After extensive
+    # exploration there doesn't appear to be a way to turn this off. We could normally
+    # using stty to set the output column width to be large, but in this case the input
+    # doesn't come from a terminal, so JLine defaults to a width of 80. To workaround
+    # the bug we process the output using this function to remove those extra characters
+    # before we do the rest of the processing. There is a remote chance that a real
+    # prompt line will have a space-CR in that spot so we will mess that one up.
     def workAroundJLineBug (self, output):
         return re.sub (r'(.{80}) \n', r'\1', output)