[TxMt] Re: TM hangs while waiting for tm_dialog2

António Afonso antonio.afonso at gmail.com
Tue Jan 27 23:38:43 UTC 2009


>Hmm. Then I would check whether your nib + script runs with DIALOG1.
>If not then check the nib, simplify your script/nib to figured out
>what's the problem is.

> The best way is to model your command like this:
>
>     #!/usr/bin/env ruby -KU
>
>     require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/tm/detach"
>
>     TextMate.detach do
>       # …your code here…
>     end
>
> This will properly detach the command (closing stdout/err) and if your
> command fails (exception) it will be presented in a nice dialog (now
> that stdout/err is gone).

I've created the simplest (I think) nib I can, just opened IB, created
a window and saved it.
With that in mind I did the following tests:

#!/usr/bin/env ruby -KU
begin
    token = %x{"$DIALOG" nib --load ~/Desktop/Simple}
    print %x{"$DIALOG" nib --wait #{token}}
rescue
    print $!
end
Same issue as before

#!/usr/bin/env ruby -KU
require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/detach"
TextMate.detach do
	token = %x{"$DIALOG" nib --open ~/Desktop/Simple}
	%x{"$DIALOG" nib --wait #{token}}
end
It looks like the block doesn't get executed, nothing happens at all...

#!/usr/bin/env ruby -KU
%x{"$DIALOG_1" ~/Desktop/Simple 2&>1}
Again, nothing happens, without the redirection (2&>1) it just hangs
like it says in the help.

I have no problems in the command line though:
$ "$DIALOG" nib --load ~/Desktop/Simple
33$ "$DIALOG" nib --wait 33
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>eventInfo</key>
        <dict>
                <key>type</key>
                <string>closeWindow</string>
        </dict>
        <key>model</key>
        <dict/>
</dict>
</plist>

It's probably some stupid mistake I'm doing :(

Cumprimentos,
António Afonso



More information about the textmate mailing list