[TxMt] Re: TM hangs while waiting for tm_dialog2

Allan Odgaard mailinglist at textmate.org
Tue Jan 27 17:08:03 UTC 2009


On 26 Jan 2009, at 21:02, António Afonso wrote:

> I was actually hoping to have the script directly in the bundle
> command, nonetheless, I've put the code in an external file and
> changed the command to:

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).




More information about the textmate mailing list