adding comments
authorpenk
Wed, 18 Sep 2002 18:07:10 +0200
changeset 2194 d008bb991def
parent 2193 41d5d33c9f78
child 2195 dd542ce8405f
adding comments
TerminalView.st
VT100TerminalView.st
--- a/TerminalView.st	Wed Sep 18 17:27:40 2002 +0200
+++ b/TerminalView.st	Wed Sep 18 18:07:10 2002 +0200
@@ -1218,6 +1218,7 @@
 !
 
 initialize
+
     super initialize.
 
     Debug := false.
@@ -1810,5 +1811,5 @@
 !TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.100 2002-09-18 14:32:01 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.101 2002-09-18 16:07:07 penk Exp $'
 ! !
--- a/VT100TerminalView.st	Wed Sep 18 17:27:40 2002 +0200
+++ b/VT100TerminalView.st	Wed Sep 18 18:07:10 2002 +0200
@@ -410,14 +410,8 @@
 initialize
     super initialize.
 
-    " vt100 dont handle cr-nl, only cr ('\n') is used 
-      in canonical mode the bash on the other side sends only '\n' on change line
-      thats why no change of terminal input output modes is useful
-      support the plain vt100 protocol
-    "
-
-    inputTranslateCRToNL := true.
     parameters := Array new:8.
+    currentParam := 1. 
     self endOfSequence
 
     "Created: / 10.6.1998 / 14:46:07 / cg"
@@ -435,6 +429,15 @@
 
 setTerminalModes
 
+    " vt100 sends and expect nl instead of cr-nl 
+      we need that because the bash under UNIX works in non-canonical mode
+      the bash sends always a nl when characters swap over column size
+      to get same behavior for e.g. ls in canonical mode which is sending cr-nl
+      and bash we have to set the terminal for canonical mode to sending nl 
+      instead of cr-nl
+      so we make a new line with positioning at first column on cr and nl
+    "
+
     OperatingSystem isUNIXlike ifTrue:[
         (inStream notNil 
         and:[inStream isExternalStream
@@ -444,12 +447,11 @@
             ].
         ].
     ].
-    super setTerminalModes.
 ! !
 
 !VT100TerminalView methodsFor:'processing - input'!
 
-addToParameter: char
+addToParameter:char
     "The parameter char is a digit. Add it to the current parameter."
 
     | param |
@@ -473,7 +475,19 @@
 !
 
 nextPut:char
-    "process a character (i.e. the shells output)"
+    " process a character (i.e. the shells output)
+
+      vt100 sends and expect nl instead of cr-nl 
+      we need that because the bash under UNIX works in non-canonical mode
+      the bash sends always a nl when characters swap over column size
+      to get same behavior for e.g. ls in canonical mode which is sending cr-nl
+      and bash we have to set the terminal for canonical mode to sending nl 
+      instead of cr-nl
+      so we make a new line with positioning at first column on cr and nl
+      (Character return -> cr)
+      (Character nl -> nl)
+      (Character cr -> nl)
+    "
 
     | processCharacterReturn |
 
@@ -481,9 +495,6 @@
         Transcript show:state; show:' '; showCR:char storeString.
     ].
 
-    " Character return has code of cr in Smalltalk/X
-      vt 100 sends cr for cr-nl        
-    "
     (char == Character return or:[char == Character nl]) ifTrue:[ 
         (rangeEndLine notNil and:[rangeEndLine ~~ numberOfLines]) ifTrue:[
             self endEntry.
@@ -572,7 +583,7 @@
         ^ #waitForNextChar
     ].
     char isDigit ifTrue: [
-        self addToParameter: char.
+        self addToParameter:char.
         ^ #waitForNextChar
     ].
     (char == $l 
@@ -874,5 +885,5 @@
 !VT100TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.35 2002-09-18 14:32:03 penk Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/VT100TerminalView.st,v 1.36 2002-09-18 16:07:10 penk Exp $'
 ! !