perl5db.pl Mac OS X fix
authorBo Lindbergh <blgl@hagernas.com>
Thu, 14 Dec 2006 13:34:06 +0000 (14:34 +0100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 14 Dec 2006 12:43:20 +0000 (12:43 +0000)
Message-Id: <658AFA03-517E-4068-93CA-06D4A93B5CA5@hagernas.com>

p4raw-id: //depot/perl@29555

lib/perl5db.pl

index 0effa3b..4c88e64 100644 (file)
@@ -6212,6 +6212,11 @@ a new window.
 # There's no direct accessor for the tty device name, so we fiddle
 # with the window title options until it says what we want.
 #
+# Since "do script" is implemented by supplying the argument (plus a
+# return character) as terminal input, there's a potential race condition
+# where the debugger could beat the shell to reading the command.
+# To prevent this, we wait for the screen to clear before proceeding.
+#
 # Tested and found to be functional in Mac OS X 10.3.9 and 10.4.8.
 
 sub macosx_get_fork_TTY
@@ -6230,6 +6235,9 @@ tell application "Terminal"
         set custom title to ""
         copy name to thetitle
         set custom title to "forked perl debugger"
+        repeat while (length of first paragraph of (get contents)) > 0
+            delay 0.1
+        end repeat
     end tell
 end tell
 "/dev/" & thetitle