TerminalView.st
changeset 934 b450dbaeedac
parent 933 de456e07697e
child 935 7ea0854209a5
--- a/TerminalView.st	Wed Jun 10 17:37:18 1998 +0200
+++ b/TerminalView.st	Wed Jun 10 18:24:16 1998 +0200
@@ -203,11 +203,24 @@
         ]
     ].
 
-    Transcript show:'ignored: '; showCR:rawKey.
+    (rawKey startsWith:'Control') ifTrue:[
+        ^ self
+    ].
+    (rawKey startsWith:'Shift') ifTrue:[
+        ^ self
+    ].
+    (rawKey startsWith:'Alt') ifTrue:[
+        ^ self
+    ].
+    (rawKey startsWith:'Cmd') ifTrue:[
+        ^ self
+    ].
+
+    Transcript show:'unhandled: '; showCR:rawKey.
 
 "/    super keyPress:aKey x:x y:y
 
-    "Modified: / 10.6.1998 / 17:12:55 / cg"
+    "Modified: / 10.6.1998 / 17:51:21 / cg"
 !
 
 shellTerminated
@@ -304,7 +317,7 @@
 doSendInterrupt
     OperatingSystem sendSignal:(OperatingSystem sigINT) to:shellPid negated.
 
-    "Modified: / 10.6.1998 / 15:22:22 / cg"
+    "Modified: / 10.6.1998 / 17:49:49 / cg"
 ! !
 
 !TerminalView methodsFor:'initialization'!
@@ -313,7 +326,8 @@
     |pid|
 
     (pid := shellPid) notNil ifTrue:[
-        Transcript print:'killing shell pid='; showCR:pid.
+"/        Transcript print:'killing shell pid='; showCR:pid.
+
         OperatingSystem terminateProcessGroup:pid.
         OperatingSystem terminateProcess:pid.
         Delay waitForSeconds:1.
@@ -338,7 +352,7 @@
         outStream := nil
     ].
 
-    "Modified: / 10.6.1998 / 12:08:25 / cg"
+    "Modified: / 10.6.1998 / 17:53:49 / cg"
 !
 
 destroy
@@ -435,10 +449,18 @@
 !
 
 keyboardMap
+    "return my keyboard map. This has control keys removed and
+     those will be passed unchanged to the shell"
+
     ^ kbdMap
+
+    "Modified: / 10.6.1998 / 17:46:59 / cg"
 !
 
 startReaderProcess
+    "Start a reader process, which looks for the commands output,
+     and sends me #peocessInput:n: events whenever something arrives."
+
     readerProcess isNil ifTrue:[
         readerProcess := [
             [
@@ -456,7 +478,6 @@
 
                             n > 0 ifTrue:[
                                 self pushEvent:#processInput:n: with:buffer with:n.
-                                "/ self nextPutAll:(buffer copyTo:n).
                             ] ifFalse:[
                                 n == 0 ifTrue:[
                                     outStream atEnd ifTrue:[
@@ -477,13 +498,17 @@
     ]
 
     "
-     VT52TerminalView openShell
+     VT100TerminalView openShell
     "
 
-    "Modified: / 10.6.1998 / 17:30:51 / cg"
+    "Modified: / 10.6.1998 / 17:46:23 / cg"
 !
 
 startShell
+    "start a shell on a pseudo terminal.
+     Also fork a reader process, to read the shells output and
+     pass it back to me."
+
     |p slaveFD execFdArray blocked exitStatus|
 
     p := ExternalStream makePTYPair.
@@ -546,10 +571,10 @@
     self startReaderProcess.
 
     "
-     VT52TerminalView openShell
+     VT100TerminalView openShell
     "
 
-    "Modified: / 10.6.1998 / 16:22:59 / cg"
+    "Modified: / 10.6.1998 / 17:46:28 / cg"
 ! !
 
 !TerminalView methodsFor:'menu'!
@@ -596,28 +621,6 @@
 
 !TerminalView methodsFor:'processing - input'!
 
-basicNextPut:aCharacter
-    super nextPut:aCharacter
-!
-
-nextPutAll:aCollection
-    |l idx idx2 wasOn|
-
-    wasOn := self hideCursor.
-
-    l := aCollection size.
-    idx := 1.
-    [idx <= l] whileTrue:[
-        self nextPut:(aCollection at:idx).
-        idx := idx + 1.
-    ].
-
-    self makeCursorVisibleAndShowCursor:wasOn.
-    self endEntry.
-
-    "Modified: / 10.6.1998 / 17:13:41 / cg"
-!
-
 processInput:buffer n:count
     1 to:count do:[:i |
         self nextPut:(buffer at:i).
@@ -660,5 +663,5 @@
 !TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.16 1998-06-10 15:37:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.17 1998-06-10 16:23:59 cg Exp $'
 ! !