From: Bo Lindbergh Date: Thu, 14 Dec 2006 13:34:06 +0000 (+0100) Subject: perl5db.pl Mac OS X fix X-Git-Tag: accepted/trunk/20130322.191538~16349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52cd570b156cb8d25d4b58a0d3609d882939ce85;p=platform%2Fupstream%2Fperl.git perl5db.pl Mac OS X fix Message-Id: <658AFA03-517E-4068-93CA-06D4A93B5CA5@hagernas.com> p4raw-id: //depot/perl@29555 --- diff --git a/lib/perl5db.pl b/lib/perl5db.pl index 0effa3b..4c88e64 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -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