TerminalSession.st
changeset 4551 96b63e5277cb
parent 4550 f2d6c8249ad8
child 4552 58fa57876769
--- a/TerminalSession.st	Sat Dec 23 13:34:32 2017 +0100
+++ b/TerminalSession.st	Sat Dec 23 15:31:02 2017 +0100
@@ -521,7 +521,7 @@
     ] ifFalse:[
         self startCollectingOutputTo:aStreamOrNil
     ].
-    self onPrompt:prompt do:[:strings | output := strings. sema signal. ].
+    self onPrompt:prompt do:[:strings | output := strings. sema signalOnce. ].
 
     aBlock value.
 
@@ -531,7 +531,13 @@
 
         (gotPrompt := (sema waitWithTimeout:seconds) notNil) ifFalse:[
             newSize := collectedOutput size.
-            Transcript show:'timeout - output size is: '; showCR:newSize.
+            self debuggingCodeFor:#cg is:[
+                Transcript show:'timeout - output size is: '; showCR:newSize.
+                (newSize between:1 and:1000) ifTrue:[
+                    Transcript show:'output is: '; showCR:collectedOutput contents.
+                ].
+            ].
+
             newSize > 100000 ifTrue:[
                 self stopCollectingOutput.
                 self onPrompt:nil do:nil.
@@ -546,7 +552,7 @@
             ].
             lastSize := newSize.
         ].  
-    ] doWhile:[ gotPrompt not ].
+    ] doUntil:[ gotPrompt ].
 
     output notEmptyOrNil ifTrue:[
         output first isEmpty ifTrue:[
@@ -597,8 +603,14 @@
     "send an INT-signal to the shell (UNIX only)"
 
     shellPid notNil ifTrue:[
-        OperatingSystem interruptProcessGroup:shellPid.
-        OperatingSystem interruptProcess:shellPid.
+        OperatingSystem isUNIXlike ifTrue:[
+            OperatingSystem interruptProcessGroup:shellPid.
+            OperatingSystem interruptProcess:shellPid.
+        ] ifFalse:[
+            'TerminalSession [info]: IRQ unimplemented for DOS' infoPrintCR.
+        ].
+    ] ifFalse:[
+        'TerminalSession [info]: no shell' infoPrintCR.
     ].
 
     "Modified: / 10.6.1998 / 17:49:49 / cg"