Hi all,
I posted some noise a few days ago about replacing the system read() function with an implementation that worked with tm_dialog for the purpose of allowing user's to enter input into scripts/processes running inside of TextMate (where normally you would enter it on the command line).
I have an example of this working in the Groovy bundle.
http://macromates.com/svn/Bundles/trunk/Bundles/Groovy.tmbundle/ Support/bin/groovymate.rb
In particular ...
TextMate::DialogRead.init :title => 'GroovyMate', :prompt => "The script is requesting some input:"
What this does is set some environment variables up for the process that is about to launch (in this case `groovy $TM_FILENAME`). Now whenever the running Groovy script reads from STDIN, and there is no data currently there, a dialog is presented allowing input to be given.
This is not quite production ready, but if you want to use this kind of thing in your bundle I would appreciate you giving it a try so I can find issues faster. Contact me if you want to try it out.
Just to be clear, this is not tied to Groovy in any way. It's just what I chose for the example.
LD.
On Mar 5, 2008, at 5:36 PM, Luke Daley wrote:
What this does is set some environment variables up for the process that is about to launch (in this case `groovy $TM_FILENAME`). Now whenever the running Groovy script reads from STDIN, and there is no data currently there, a dialog is presented allowing input to be given.
So... If the PHPMate stuff switched to this, I would be able to enter cli arguments when running a php script?
Amazing!
On 06/03/2008, at 2:34 PM, Eric Coleman wrote:
So... If the PHPMate stuff switched to this, I would be able to enter cli arguments when running a php script?
You could actually do that now with some adjustments to PHPMate (I'll take a look).
What this means is that if your scripts asks for input (say username or password) TextMate will bring up a dialog for you to enter it.
LD.