[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 [0m[01;32mcolors.sh[0m*
lrwxr-xr-x 1 root 9 2007-07-05 10:06 [01;36m2-sym_link[0m ->
[01;33m/dev/null[0m
brw-r--r-- 1 root 14, 0 2006-06-09 15:38 [01;33m6-block_special[0m
crw-r--r-- 1 root 3, 2 2006-06-09 15:38 [01;33m7-char_special[0m
-rw-r--r-- 1 dzurnlocal 0 2006-06-09 15:38 0-file
drwxr-xr-x 2 dzurnlocal 68 2006-06-09 15:38 [01;34m1-directory[0m/
-rwxrwxrwx 1 dzurnlocal 0 2006-06-09 15:38 [01;32m5-executable[0m*
-rwsrwxrwx 1 dzurnlocal 0 2006-06-09 15:38 [37;41m8-exe_setuid[0m*
-rwxrwsrwx 1 dzurnlocal 0 2006-06-09 15:38 [30;43m9-exe_setgid[0m*
drwxrwxrwt 2 dzurnlocal 68 2006-06-09 15:38
[30;42ma-dir_writeothers_sticky[0m/
drwxrwxrwx 2 dzurnlocal 68 2006-06-09 15:38
[34;42mb-dir_writeothers_NOsticky[0m/
--
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