LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Thread Tools
Old 12-28-2008, 11:01 AM   #1
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14
Thanked: 0
Which text editor supports ANSI escape sequences?


[Log in to get rid of this advertisement]
Hey,

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?

Thanks,
Mintz Yuval
mintzyuval is offline     Reply With Quote
Old 12-28-2008, 11:47 AM   #2
mk27
Member
 
Registered: Sep 2008
Distribution: FC7, FC10, lenny (a wee bit)
Posts: 96
Thanked: 5
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.
mk27 is offline     Reply With Quote
Old 12-28-2008, 12:55 PM   #3
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14
Thanked: 0

Original Poster
I guess you're right and I've mis-pronounced my purpose.

I'll google for it; if someone can point me to such a viewer, I'd be grateful.

Thanks,
Mintz Yuval
mintzyuval is offline     Reply With Quote
Old 12-29-2008, 05:16 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 1,885
Thanked: 88
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.
salasi is offline     Reply With Quote
Old 08-05-2009, 08:17 PM   #5
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: Mandriva 2009.1, Debian Etch
Posts: 344
Thanked: 7
Best I could find on this...

http://blog.hartwork.org/?p=88
DaveQB is offline     Reply With Quote
Old 08-05-2009, 09:22 PM   #6
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,881
Thanked: 232
You might want to look at the Text Terminal HOWTO at the www.tldp.org website.

http://tldp.org/HOWTO/Text-Terminal-HOWTO.html#toc22

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.

Last edited by jschiwal; 08-05-2009 at 09:27 PM..
jschiwal is offline     Reply With Quote
Old 08-05-2009, 09:40 PM   #7
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: Mandriva 2009.1, Debian Etch
Posts: 344
Thanked: 7
Thanks. Yeah I read the less manual,but not thoroughly enough.

http://www.linuxquestions.org/questi...uences-511166/

less -R <file with escape characters>
DaveQB is offline     Reply With Quote
Old 08-08-2009, 02:57 PM   #8
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14
Thanked: 0

Original Poster
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.
mintzyuval is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Less outputs ANSI escape sequences sprocketboy Mandriva 2 08-05-2009 09:22 PM
escape sequences in enscript lanco Linux - Newbie 1 03-01-2009 03:32 PM
LXer: CLI Magic: Use ANSI escape sequences to display a clock in your terminal LXer Syndicated Linux News 0 01-22-2008 11:20 PM
How to stop terminal escape sequences ? Mike Davies Linux - Newbie 1 08-08-2004 12:37 PM
Xterm escape sequences GrayGh0st Linux - Software 3 07-19-2003 01:10 AM


All times are GMT -5. The time now is 06:38 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration