RobbieCanuck
RobbieCanuck

Reputation: 1631

Correct Putty configuration for Ubuntu 9.04

I often use Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) to connect to Ubuntu boxes (9.04 now). It works well, but I can't figure out the correct combination of Putty font, character encoding, character translation, and terminal configuration on the Ubuntu end so that the terminal displays everything correctly. The problem is most obvious when running an ncurses program such as "screen-profiles" or "w3m". The box drawing characters are messed up.

Has anyone got this combination working to their satisfaction?

Upvotes: 22

Views: 14486

Answers (6)

Ian Abbott
Ian Abbott

Reputation: 291

Try exporting the following environment variable

export NCURSES_NO_UTF8_ACS=1

That stops ncurses using the VT100 "Alternate character set" line drawing characters in a UTF-8 locale, and makes it use the Unicode box-drawing characters instead.

Upvotes: 29

aquafunk
aquafunk

Reputation: 101

Not to dig up an old post, but KiTTY (a PuTTY fork) provides a checkbox to "Allow ACS line drawing in UTF" (new/current session settings->Window->Translation) which seems to work well with apps like aptitude. I just downloaded the latest version of PuTTY, and this checkbox is not present, so it must be KiTTY specific.

The other answers are not wrong about the issue at hand; this is just an alternative to additional environment variables or changing the advertised terminal type. (see also https://stackoverflow.com/a/8485457/1011365 for more info if you're using screen/tmux and how termcap is involved, though FYI I'm using an up-to-date tmux and still needed to check the box in KiTTY to allow the characters to appear correctly)

Upvotes: 0

helt
helt

Reputation: 5197

In my case, it wasnt ncurses, nor putty. It was the locale, which was not set to UTF-8...

so locale call yielded the result below.

$ locale
LANG=en_US

However, whats needed was

$ locale
LANG=en_US.UTF-8

And i was able to achieve that by

$ sudo locale-gen en_US.UTF-8
$ sudo update-locale LANG=en_US.UTF-8

Upvotes: 0

Daniel Sokolowski
Daniel Sokolowski

Reputation: 12458

Putty (or enchanced fork Kitty) appernetly both don't honor the request to swtich to VT100 style line drawing mode when in 'UTF-8' for example in aptitude - this is by design (http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/utf8-plus-vt100.html).

However if we set 'Connection > Data > Terminal-type string' to 'putty' instead of the default 'xterm' it solves the issues because the server adjusts the rendering characters.

I believe this solution is better then using export NCURSES_NO_UTF8_ACS=1 which I have used up until now myself.

fix Putty line drawing issues

Upvotes: 4

piyo
piyo

Reputation: 794

I use Putty mainly to interact with my Ubuntu vm-boxen so I do spend some time getting the visual configuration correct. Basically, I set the font to MS Gothic, 9pt (for monospaced and Japanese), UTF-8 for received data, and terminal-type string to xterm-256color. I leave most of the Terminal settings alone because the defaults seem to work well.

On the Ubuntu side, I set LANG=en_US.UTF-8, aptitude install ncurses-term for additional terms. I check the terminal colorness via a nice script, and double check within a GNU Screen session and GNU Emacs (M-x list-colors-display). GNU Screen is not compiled with 256 color option so i re-compile it. I check the language by using Emacs (M-x view-hello-file) and also tig a git directory with i18n utf-8 log commits.

Unfortunately I still do get the weird "lqqqqk" thing on aptitude (line art missing?) but the spacing is still correct. Also pressing backspace in aptitude does a character insert, which I still have not conquered. Also I tested your command line w3m on my system and it looks nice. I rather use w3m from emacs, tho. :-)

Truth be told, I use a Japanese fork of Putty called Gottani (PuTTY ごった煮版) that helps more with Japanese but I think its pretty close to the normal Putty.

Aside: I also set Terminal > Features > Disable remote-controlled terminal resizing because `GNU Screen" overrides my window size setting.

All of the above is tested on Ubuntu 8.04 LTS "Hardy Heron".

Upvotes: -1

RobbieCanuck
RobbieCanuck

Reputation: 1631

The best I've been able to come up with is to change the putty configuration in Window/Translation to UTF-8 and the font in Window/Appearance to Lucida Console.

It gets most of the characters correct. In "aptitude" the menus are correctly outlined in line drawing characters, but not the "Are you sure you wish to exit" pop up dialog. Running a command like "man ls" now shows most of the characters correctly, but hyphenated words end up with a box replacing the hyphen.

It's good enough for programming in Emacs, anyway. Better solutions appreciated.

Upvotes: 11

Related Questions