[TxMt] Re: Colorizing ANSI Terminal output in TextMate?

Steve King sking at arbor.net
Fri Apr 16 14:17:49 UTC 2010


On 2010-04-16 07:59, subtleGradient wrote:
> Unfortunately there is no easy way to emulate that in TextMate since ANSi
> codes are stream based and TextMate is scope based. I'm tempted by the
> challenge, but I just don't think it's worth the amount of time it would
> take to make it mostly work.
>    

I was thinking maybe something could be done by treating the escape 
codes much the same way as you would opening/closing tags in HTML. 
Unfortunately that wouldn't remove the codes from the display. IMHO that 
limitation would destroy the usefulness.

On the other hand, it should be fairly simple to reformat the ANSI codes 
as HTML. Just write a command to convert the document and display it as 
HTML. That would at least make it pleasing to the eye, without modifying 
the ANSI sequences in the original file. You couldn't edit in the HTML 
window, but I get the impression that dzurn isn't looking for something 
editable. Try the Perl script ansi2html as a starting point.

http://search.cpan.org/~autrijus/HTML-FromANSI-1.01/script/ansi2html 
<http://search.cpan.org/%7Eautrijus/HTML-FromANSI-1.01/script/ansi2html>

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3874 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.macromates.com/textmate/attachments/20100416/649dff7d/attachment.p7s>


More information about the textmate mailing list