Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Mix ANSI colors, screen and encodings in Terminal UNIX
Terminal.app is great program, I really like it, but it has some issues.

The first issue are the ANSI colors -- blue and red are to dark for me, and white is too bright. The best way to fix it is to install the great plug-in called TerminalColors, made by Mike Solomon. It really works and gives you ability to tweak ANSI colors with regular color panel.

The second issue is a very short list of supported encodings (charsets), and this is a big problem for people like me. Recently I found that my beloved screen program (found in /usr/bin/screen) also supports a lot of encodings including UTF-8, so I decided to crossbreed it with Terminal. If you simply call screen from your Terminal.app like this:
screen -U
it will launch in UTF-8 mode. UTF-8 is default encoding for Terminal.app, so they fit perfectly to each other. Then press Control-A, followed by a colon, then type encoding KOI8-R and hit Return. From this moment on, screen will translate all input and output between UTF-8 and KOI8-R automatically. For a full list of encodings, open the man page of screen and search for keyword "KOI8" -- this will jump you right into the list of encodings. Also you may setup default encoding in ~/.screenrc with the option defencoding.

Actually I went farther and set /usr/bin/screen -l -U -xRR as my default shell in Terminal. Now Terminal works as a perfect viewer for screen. I can have many Terminal windows opened simultaneously pointing to different screen displays.
    •    
  • Currently 1.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[12,509 views]  

Mix ANSI colors, screen and encodings in Terminal | 12 comments | Create New Account
Click here to return to the 'Mix ANSI colors, screen and encodings in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Kills my terminal
Authored by: nvdingo on Aug 27, '04 12:54:37PM

OS X 10.3.3

Terminal.app (not modified in any way ever) simply quits with the plugin installed whenever you try bring up the Window Settings pane.

removal fixed the problem

Dual 1GHz G4
1.5G ram
no preferences problems either.



[ Reply to This | # ]
Kills my terminal
Authored by: bluehz on Aug 28, '04 09:55:25AM

Be wary of TerminalColors - it does not indicate it on the website - but if you read the info that appears as you are installing it you will notice it states "Jaguar Only". I proceeded anyway and installed it on my Panther system, and now I am paying the price. TerminalColors appeared to work at first, but terminal kept randomly crashing. So I removed all traces of TerminalColors... yet the crashes remain..... sigh......



[ Reply to This | # ]
My terminal is fine
Authored by: atverd on Aug 28, '04 09:48:46PM

Never had a single crash yet. Terminal version 1.4.3 (v100), OS X 10.3.5.
This is really strange, actually - probably it would be good idea to make a backup copy of your Terminal before installing this plugin.



[ Reply to This | # ]
My terminal is (mostly) fine
Authored by: Ipstenu on Aug 30, '04 11:31:59AM

I have the same setup as above (Terminal 1.4.3 v 100, OS 10.3.5) and when I installed the plugin, I can't open a new window. Apple-N, or File New. Nothing working. Uninstalling fixed the issue, and I emailed the author.

Damn, I wish it worked.



[ Reply to This | # ]
Try to upgrade SIMBL.
Authored by: atverd on Aug 30, '04 12:04:46PM

Ok, another idea - TerminalColor goes with library SIMBL of some rather old version. There is a new version http://culater.net/dl/files/SIMBL-0.5.tbz, try to install it after TerminalColor installation - it will upgrade the existing one to the latest version 0.5. I tried it and it works fine so far.



[ Reply to This | # ]
Mix ANSI colors, screen and encodings in Terminal
Authored by: astack on Aug 27, '04 12:54:59PM

TerminalColors works as expected. For me I had to change the nasty livid green color that blinded me every time I saw it. Now its more palatable, which is great!

Using screen and changing the encoding, I still can't actually see accented characters in the Terminal windows (using "ls", entering accented characters in the command line sometimes works). Am I missing something?



[ Reply to This | # ]
Mix ANSI colors, screen and encodings in Terminal
Authored by: atverd on Aug 27, '04 01:48:49PM

It's not related directly to terminal encoding - I think you need to setup locale to make ls display accented characters. There is not much info about this in OS X man pages, but there is plenty of docs on internet for linux and mostly all these things applicable to OS X too. In short - you need to find your locale in /usr/share/locale and try to call ls like this (example):

LC_ALL=fr_BE.UTF-8 ls -l

This means french, belgian variant, output encoding is UTF-8. LC_ALL is environment variable which specifying your locale and you may assign it in .bashrc f.e. or .bash_profile in your home directory to make it default.



[ Reply to This | # ]
Mix ANSI colors, screen and encodings in Terminal
Authored by: astack on Aug 27, '04 04:52:49PM

Okay, thanks, this is interesting. When I set the environmental variable to say, fr_FR.UTF-8, ls -la now shows the months that the file was created in French (with appropriate accents on the characters), but my filenames with accented characters still don't appear properly. It doesn't matter if I create the file from the gui (aqua) or I do it from the command line, the accents appear as e??i??, etc.



[ Reply to This | # ]
Mix ANSI colors, screen and encodings in Terminal
Authored by: astack on Aug 27, '04 05:02:23PM

Oh duh. Type "ls -v" to properly render accented characters.



[ Reply to This | # ]
specific encoding?
Authored by: clytie on Aug 29, '04 12:17:32AM

Thanks very much for the hints. :)

I, too, am trying to live between MacOSX's "full Unicode support" and the realities, especially in applications, even those default with OSX.

I'm also very new to CLI, so please excuse dumb questions.

I need to be able to set up Terminal etc. to display Vietnamese, which is Unicode (one of the default Unicode keyboards with the system), language id "vi".

Do I just plug "vi" into your command, or do I need to say it twice? <muddled>

Much appreciation for any help offered <she says earnestly from within a thick fog>

from Clytie

---
Clytie Siddall -- Renmark, in the Riverland of South Australia

iBook G3, 10.3.5, all updates current



[ Reply to This | # ]
specific encoding?
Authored by: atverd on Aug 29, '04 01:19:32AM

I wish I could help you, but this is way too different from languages I have an experience with. The best way for you would be search on google for your language specific info, keywords "vietnamese locale mac os x". There are always "small" details and I'm pretty sure there are ready recipes made by native guys who know what they are talking about. One hint though, make sure there are directories starting with "vi" in /usr/share/locale on your mac. If not - don't bother, you'll need to find way to install needed locales to your system. On my system there are no such locales. If there are try them all - probably there will be "vi" and "vi_VI" at least.
Sorry, that's all :)



[ Reply to This | # ]
Mix ANSI colors, screen and encodings in Terminal
Authored by: Ipstenu on Sep 08, '04 11:52:54PM

Aha! That was it!



[ Reply to This | # ]