[TxMt] Colorizing ANSI Terminal output in TextMate?

dzurn daz-macromates at zzzurn.com
Thu Apr 15 14:29:44 UTC 2010


I frequently pipe the output of Terminal.app commands to view/search with
TextMate, but for commands like "ls -al --color=always" I'd like to still
see the ANSI terminal colors even though I keep the piped output in Textmate
for future reference.

So something like
    %   echo -e "\\e[0;32mCOLOR_GREEN\\t\\e[1;32mCOLOR_LIGHT_GREEN\\e[0m"
would show up (colored) in TextMate as
    COLOR_GREEN      COLOR_LIGHT_GREEN
It'd be fine if the actual escape codes were still there but de-emphasized.

If nothing else, it would save me from running a regex through
search/replace to remove the ANSI escape codes when my output already took a
while to generate. And I like the "do it once, keep it forever" factor of a
TextMate bundle ;)

If there's any existing bundle which has those codes already in a language
grammar, I'd appreciate it.

Thanks
Darryl

ls example:
total 8.0K
-rwx--x--x 1 dzurnlocal   515 2010-04-14 16:16 colors.sh*
lrwxr-xr-x 1 root           9 2007-07-05 10:06 2-sym_link ->
/dev/null
brw-r--r-- 1 root       14, 0 2006-06-09 15:38 6-block_special
crw-r--r-- 1 root        3, 2 2006-06-09 15:38 7-char_special
-rw-r--r-- 1 dzurnlocal     0 2006-06-09 15:38 0-file
drwxr-xr-x 2 dzurnlocal    68 2006-06-09 15:38 1-directory/
-rwxrwxrwx 1 dzurnlocal     0 2006-06-09 15:38 5-executable*
-rwsrwxrwx 1 dzurnlocal     0 2006-06-09 15:38 8-exe_setuid*
-rwxrwsrwx 1 dzurnlocal     0 2006-06-09 15:38 9-exe_setgid*
drwxrwxrwt 2 dzurnlocal    68 2006-06-09 15:38
a-dir_writeothers_sticky/
drwxrwxrwx 2 dzurnlocal    68 2006-06-09 15:38
b-dir_writeothers_NOsticky/


-- 
View this message in context: http://old.nabble.com/Colorizing-ANSI-Terminal-output-in-TextMate--tp28256046p28256046.html
Sent from the textmate users mailing list archive at Nabble.com.




More information about the textmate mailing list