[TxMt] Re: scriptmate.rb question

Patrick Gundlach textmate at contextgarden.net
Wed Mar 14 10:25:30 UTC 2007


Hi Allan, others,

>> [...]
>> is trying to get 4 parameters from @command.run, but UserCommand#run
>> only returns 3. A related question: is it possible to get a pid from
>> popen3?
>
> I recently wrote a custom version for popen3 to get the pid (so that
> we could provide the ⌃C-break functionality) -- likely the subclass
> you refer to (UserScript) needs appropriate updating (I’ll check it
> out later).

I've checked out todays support directory and have a few problems:

----------------
$:.unshift ENV['TM_SUPPORT_PATH'] + "/lib"

require 'scriptmate'

cmd_mate('ls')
----------------

gives me

/Users/pg/Library/Application Support/TextMate/Support/lib/scriptmate.rb:106:in `emit_html': undefined method `fcntl' for [#, #]:Array (NoMethodError)
	from /Users/pg/Library/Application Support/TextMate/Support/lib/scriptmate.rb:106:in `each'
	from /Users/pg/Library/Application Support/TextMate/Support/lib/scriptmate.rb:106:in `emit_html'
	from /Users/pg/Library/Application Support/TextMate/Support/lib/scriptmate.rb:46:in `cmd_mate'
	from parse_texrun.rb:10

when I change line 56 in scriptmate.rb to

    return stdout, stderr, File.open('/dev/null'), pid

(I vaguely remember this being in the old scriptmate.rb), I get an
output with a surprising  'nil' at the end:


....  <--- OK
....  <--- OK
nil   <--- unwanted


Thanks so far,

Patrick



More information about the textmate mailing list