[SVN] REQ: commands choosing output
Chris Thomas
chris at cjack.com
Sun Feb 20 08:55:40 UTC 2005
On Feb 19, 2005, at 11:38 PM, Allan Odgaard wrote:
> On Feb 19, 2005, at 19:02, Eric Hsu wrote:
>
>> Perhaps a future TM could let commands set $TM_COMMAND_OUTPUT and
>> tell TM how it prefers to be seen?
>
> Unfortunately I do not think that I can read variables from the
> process after having launched it.
>
>> This might in general be the slickest way for commands to talk to
>> TM, making special shell variables a two-way street.
>
> I would like to introduce something that would allow the command to
> select output, so far I've considered using escape codes similar to a
> real terminal, so e.g. you'd do:
>
> printf '\033[O:HTML]'
>
> Or similar to set the output to HTML. Though it would require some
> thought before I venture into this -- maybe this could also reduce
> the current clutter I think exists in the “output” popup menu (i.e.
> too many choices IMHO).
I agree there's some clutter in that menu, but -- even as much as I
desire callbacks -- I'd prefer to see a callback method via scripting
(presumably AppleScript) worked out before this sort of solution is
implemented. Partly because escape codes do not make scripts more
readable; partly because you'd be implementing yet another syntax
inside those brackets, a small one, perhaps, but the temptation to
implement more over time might be difficult to resist given the
constant demands from us ungrateful bundle developers; partly because
this sort of mechanism strikes me as really kludgy, on a purely
aesthetic level; partly because I can also see bugs in scripts causing
serious havoc. If a script inadvertently writes a binary to the output
-- perhaps because the script didn't validate the user's input
carefully -- what happens? Etc.
For what it's worth,
Chris
More information about the textmate-dev
mailing list