Colors get messed up, i think when tailing log files

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help

Colors get messed up, i think when tailing log files

Postby toastkid on Wed Oct 03, 2012 7:40 am

Hi all. I've got a new laptop and have installed Mint MATE on it. (previously i used Ubuntu 10).

I have a weird issue that happens periodically. I often tail log files (with tail -f so they update dynamically) and sometimes when lots of logging is scrolling past quickly while i'm viewing it, the following happens:

- the computer totally freezes for a few seconds
- when it comes back, the colours are messed up in my terminal: it seems like all the colours have changed to a different colour. (I'm using Mate Terminal 1.1). This "messing up" doesn't happen the same way every time - it seems random. I can change the ansi colour for my terminal to yellow ("\[\033[0;33m\]") for example and it comes out looking red.
- sometimes this affects my desktop apps: for example in geany or gedit, the syntax colouring has been swapped to different colours (sometimes resulting in unreadable combinations like very dark grey on black)
- restarting the terminal and affected apps makes no difference: the only way i've found to cure it is to reboot.

I mentioned this to a colleage and he theorized that some combination of characters was coming through in the logs and being interpreted as some kind of command sequence by tail, or terminal, or something. Kind of vague and very hard to investigate.

Any ideas anyone? has anyone else encountered this?

Grateful for any advice! thanks for reading.
toastkid
Level 1
Level 1
 
Posts: 6
Joined: Wed Oct 03, 2012 7:30 am

Linux Mint is funded by ads and donations.
 

Re: Colors get messed up, i think when tailing log files

Postby Fishbowler on Wed Oct 03, 2012 8:28 am

Are they system log files or logs from something else? Check to see if the log file is executable.
I had a similar problem recently using cat on some non-human-readable files. Terminal titles changing and all sorts.

Fixed the whole folder with:
Code: Select all
chmod -R a-x+X
Fishbowler
Level 1
Level 1
 
Posts: 16
Joined: Fri Mar 18, 2011 6:07 am

Re: Colors get messed up, i think when tailing log files

Postby toastkid on Wed Oct 03, 2012 10:34 am

Hi - thanks.
Fishbowler wrote:Are they system log files or logs from something else?

They're from a ruby on rails app.
Fishbowler wrote: Check to see if the log file is executable.

Ah, one of the files i've been tailing is executable. (just noticed that) I'll change it and see if the problem recurs. Thanks!
toastkid
Level 1
Level 1
 
Posts: 6
Joined: Wed Oct 03, 2012 7:30 am

Re: Colors get messed up, i think when tailing log files

Postby toastkid on Fri Oct 05, 2012 11:02 am

This just happened again, and the log file definitely wasn't executable. :/

Any more ideas, anyone?
toastkid
Level 1
Level 1
 
Posts: 6
Joined: Wed Oct 03, 2012 7:30 am

Re: Colors get messed up, i think when tailing log files

Postby catweazel on Sat Oct 13, 2012 1:46 am

That can happen if the logs contain control codes. I'd be inclined to open the file in a gui text editor and scan for odd-looking characters then remove them. If that fixes the issue then your theorising friend was right.
Mint Testing Team & Mint Donor #3606
KDE 4.12.0, custom preemptive kernel 3.12.5,
Intel i7 4770K @ 4.7GHz, 16GB 2666MHz XMP,
4 Samsung 840 PRO 512GB SSDs in RAID0,
6TB HW RAID10, dual 24" Acer X243H,
Gigabyte nVidia GTX 680 Super Overclock
User avatar
catweazel
Level 7
Level 7
 
Posts: 1655
Joined: Fri Oct 12, 2012 9:44 pm


Return to Other topics

Who is online

Users browsing this forum: No registered users and 5 guests