TerminalView.st
changeset 950 9e5834388a79
parent 948 b93aba7db15d
child 951 a9e48f549763
--- a/TerminalView.st	Fri Jun 12 22:03:46 1998 +0200
+++ b/TerminalView.st	Fri Jun 12 22:20:29 1998 +0200
@@ -238,14 +238,12 @@
         ^ self
     ].
     (rawKey startsWith:'Cmd') ifTrue:[
-        ^ self
+        ^ super keyPress:aKey x:x y:y
     ].
 
     Transcript show:'unhandled: '; showCR:rawKey.
 
-"/    super keyPress:aKey x:x y:y
-
-    "Modified: / 10.6.1998 / 17:51:21 / cg"
+    "Modified: / 12.6.1998 / 22:16:50 / cg"
 !
 
 shellTerminated
@@ -488,8 +486,13 @@
 
     ctrlKeys := kbdMap keys select:[:key | key startsWith:'Ctrl'].
     ctrlKeys do:[:key | kbdMap removeKey:key].
+
     cmdKeys := kbdMap keys select:[:key | key startsWith:'Cmd'].
-    cmdKeys do:[:key | kbdMap removeKey:key].
+    cmdKeys do:[:key | 
+        (#(Copy Paste SaveAs Print) includes:(kbdMap at:key)) ifFalse:[
+            kbdMap removeKey:key
+        ]
+    ].
 
     kbdMap removeKey:#Delete ifAbsent:[].
     kbdMap removeKey:#BackSpace ifAbsent:[].
@@ -497,6 +500,8 @@
     "
      VT52TerminalView openShell
     "
+
+    "Modified: / 12.6.1998 / 22:18:23 / cg"
 !
 
 initializeKeyboardSequences
@@ -723,13 +728,31 @@
     "paste - redefined to send the chars to the shell instead
      of pasting into the view"
 
-    someText asString string do:[:aChar |
-        inStream nextPut:aChar
-    ]
+    |s nLines|
+
+    s := someText.
+    s isString ifTrue:[
+        s := s asStringCollection
+    ] ifFalse:[
+        (s isKindOf:StringCollection) ifFalse:[
+            self warn:'selection (' , s class name , ') is not convertable to Text'.
+            ^ self
+        ]
+    ].
+    (nLines := s size) == 0 ifTrue:[^ self].
+    (nLines == 1 and:[(s at:1) size == 0]) ifTrue:[^ self].
+    s keysAndValuesDo:[:idx :line |
+        inStream nextPutAll:line.
+        idx ~~ nLines ifTrue:[
+            inStream nextPut:(Character return).
+        ]
+    ].
+
+    "Modified: / 12.6.1998 / 22:12:47 / cg"
 ! !
 
 !TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.28 1998-06-12 20:03:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.29 1998-06-12 20:20:29 cg Exp $'
 ! !