LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 08-02-2010, 08:10 AM   #1
ryujakk
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
less, ANSI colors, and search


Hi,

I'm having an annoying issue with less. What I want is to view logs with important stuff color coded, and be able to correctly use less's search function.

What happens is that less correctly displays color coded text, but offsets the search highlighting.

For instance, if I run "ls -l --color=always | less -R", and then search for some text, the highlighting will be offset if that text (or any text before it) is colored.

I tried forcing LESSANSIENDCHARS by doing a "export LESSANSIENDCHARS=m", but that didn't work.

"less --version" gives me "less 382+iso254", and I am running "SUSE LINUX Enterprise Server 9 (x86_64)".

I hope I am clear enough! Any help would be greatly appreciated!

Thank you
 
Old 08-03-2010, 07:07 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
I'm using konsole with TERM=xterm, under openSUSE 11.2 (x86_64) with KDE 4.3.5. If I issue the command sequence "ls -l --color=always | less -R", it appears to work just fine.

Are you saying that the ANSI control sequences aren't being handled properly? Which terminal program are you using?
 
Old 08-03-2010, 07:13 PM   #3
cjcox
Member
 
Registered: Jun 2004
Posts: 307

Rep: Reputation: 42
:-) It's a bug. Works fine on newer SLES. I'm guessing you need a newer version of less. I'd probably compile one from scratch and install in /usr/local/bin and test... just to see. If not that, then likely a terminfo issue in SLES9 or something like that.
 
Old 08-04-2010, 02:25 AM   #4
ryujakk
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks for your answers!
I compiled the latest version of LESS, and it indeed fixed my issue. No weird highlighting anymore :-)
 
  


Reply



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
How to configure Xterm colors if my xterm can support 256 colors n179911 Linux - Software 4 07-06-2009 02:28 AM
Is it possible for less to display colors from a grep search? tvisher Linux - Newbie 2 12-15-2008 03:22 PM
How to change shell to have nice colors and look cool? Penguin likes cool colors! newtovanilla Linux - Newbie 3 11-28-2008 12:55 PM
Ansi colors not there when editing a file robinhood1995 Linux - Software 2 04-08-2006 04:24 PM
tty09 - tty12 do not show ansi colors correctly danell_fip Linux - General 1 01-12-2004 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration