LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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
 
LinkBack Search this Thread
Old 12-28-2008, 10:01 AM   #1
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Rep: Reputation: 0
Which text editor supports ANSI escape sequences?


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
 
Old 12-28-2008, 10:47 AM   #2
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 147

Rep: Reputation: 23
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.
 
Old 12-28-2008, 11:55 AM   #3
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
Old 12-29-2008, 04:16 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,449

Rep: Reputation: 489Reputation: 489Reputation: 489Reputation: 489Reputation: 489
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.
 
Old 08-05-2009, 07:17 PM   #5
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: PCLinuxOS 2010.12, Debian Lenny
Posts: 375

Rep: Reputation: 36
Best I could find on this...

http://blog.hartwork.org/?p=88
 
Old 08-05-2009, 08:22 PM   #6
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
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 08:27 PM.
 
Old 08-05-2009, 08:40 PM   #7
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: PCLinuxOS 2010.12, Debian Lenny
Posts: 375

Rep: Reputation: 36
Thanks. Yeah I read the less manual,but not thoroughly enough.

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

less -R <file with escape characters>
 
Old 08-08-2009, 01:57 PM   #8
mintzyuval
LQ Newbie
 
Registered: Dec 2008
Location: Tel-Aviv, Israel
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 03:59 AM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration