When I launch terminal, it looks fine. Black text on a white background. BUT when I run a command that requires the screen to scroll, it turns to white text on a white background. I have to triple-click to select-all in order to see the text. I use terminal all the time, so this is super annoying. Any ideas how I can fix it?
2 Answers
Try piping your output through less.
$ command | less
You get the bonus of being able to page the output, and less might ignore the color control codes being sent by the program.
-
I can't do that because a build script runs the command, and the build is not interactive. Gotta just let it scroll. Plus, I need to see the output in case there are any errors. Thanks for the tip, though!– lo_fyeAug 20, 2009 at 2:56
-
Piping through some sort of filter is the best approach when feasible. I don’t understand from the description why this wouldn’t be possible, especially because the build is not interactive. I would expect you to not be able to use a filter if the build was interactive. Other useful filtering commands for this are
cat -v
(which converts control characters into visible sequences of non-control characters) andtee
to split the output so you can view it in the terminal and record it to a file, for example. Also, you could redirect to a file and view it in another terminal withtail
. May 3, 2012 at 6:38
Try trashing the preferences file:
com.Apple.Terminal.plist in Users//Library/Preferences
Also, can you give an example of a command that causes this behaviour?
-
Sadly, trashing the plist didn't help :( The command I run is actually a build script using Phing, a PHP port of Apache Ant. The command "phing propel" re-creates a bunch of files.– lo_fyeAug 19, 2009 at 15:22
-
Ah, and is that the only command that causes this behaviour? Because if it is (for example, man ifconfig produces a lot of output in a similar fashion i'm willing to bet) then it means that Phing is causing wonky output. Have you consulted their support team? Aug 19, 2009 at 15:24
-
man ifconfig produces nice black text on white background, but it doesn't scroll. The issue happens when the output causes the screen to scroll. That being said, I just tried: ls /* and it stayed black. So I guess it is a Phing thing. Weird. Unfortunately, as with so much PHP stuff, Phing has no support team beyond a Google Group. Thanks for your help.– lo_fyeAug 19, 2009 at 15:34
-
No problems, I wish I could help further. I feel your pain regarding the PHP stuff. I haven't used Phing however. Aug 19, 2009 at 15:36