Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have logs produced by programs that print to the terminal with colors using escape sequences.
I usually use VIM (or gvim) to open logs, but seeing all those escape sequences instead of colors really bother me.
Is there a way to set VIM to use esacape-sequences (as opposed of showing them on screen)? if not, do you happen to know a solid text-editor that can do that?
Well, the point of a text editor is to edit text files, not process them, so I'm going to guess that you're out of luck on this (on the other hand, vim can make toast and do dishes if you configure it right and want to deal with the somewhat painful documentation, so you never know).
Google around. What you want is some kind of VIEWER, not editor. This is like: you view web pages in a browser, you edit them in a text editor. They look very different in these two places for good reason -- the purpose of the text editor is for editing the html code.
I do GUI programming and it would be a simple task to write something to do what you want, so perhaps someone has done it already -- you just have to find where they put it.
Given that a number of text editors can be set to do colouring of text dependant upon input language (C, C++, perl, bash script...) if you find a tutorial on how to set up one of those for a new language, you may be able to modify things so that it highlights dependant on escape sequences. Don't underestimate the work in this approach, though.
Also look at the setting of the console program you are using. You may be able to simply change the terminal emulation settings, allowing the colors to be displayed properly when viewing a log in the less program.
Well, "less -R" obviously work - but my original intention was to find an editor that can show colored ANSI qoutes, not a viewer; and unless I'm terribly misinformed, less does not qualify as one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.