Getting Midnight Commander line drawing to work with PuTTY


When using Midnight Commander with the default settings of PuTTY connected to my Ubuntu Linux machine the line drawing characters are all messed up.

After some experimentation it turns out that to fix it all you have to do is change your character set in PuTTY to UTF-8 and the problem is fixed. To do this open up the PuTTY settings and go to Window->Translation->Received data assumed to be in which character set: and change it to UTF-8.

After making this change you might have to force a redraw of the mc screen to show the new line drawing characters:

Also not that some fonts might not have the line drawing characters available. The fonts I know work is Courier New and Lucida Console. To change your font go to Window->Appearance, Font settings and click the Change button.

For reference, I was using using Midnight Commander 4.6.1 running on Ubuntu 7.10 and using PuTTY 0.59

  • Share/Bookmark

, ,

  1. #1 by Yavuz - March 7th, 2008 at 18:45

    Oddly enough, the above fix doesn’t work for me on Arch Linux. Since the fix that did work is almost diametrically opposite, it might be an alternative starting point for others:

    In putty:
    1. Set font to Consolas under Appearance.

    2. Set encoding to ISO-8859-1 under Translation. This is weird: Arch Linux is a full UTF-8 distro, and my locale is set to en_US.UTF-8. No idea why it works; maybe mc does not really support UTF-8.

    3. Set “Use font in both ANSI and OEM modes” under Translation. This seems to ferret out the line drawing glyphs which appear to be otherwise unavailable.

    4. Set terminal-type string to “putty-256color” under Data. Not sure this is needed, but its the most specific terminal type available for putty under Arch Linux, and we might just as well use it.

    I might get bitten by the 2nd setting later on, but atm I don’t really need anything beyond normal ascii characters.

  2. #2 by Yavuz - March 7th, 2008 at 19:05

    I rechecked the Arch Linux package repositoty, and found an alternative mc-utf8 package that I had missed at first. This one does behave like it should: Lucida Console + UTF-8 encoding + Unicode linedrawing codes = proper lines. However, I lose my preferred Consolas font, which is annoying since it does seem to have the necessary glyphs, just not accessible in Unicode mode.

  3. #3 by Anonymous - March 16th, 2008 at 10:07

    thanx

  4. #4 by AndreMiller - March 22nd, 2008 at 07:57

    Thanks for the alternative solution for Arch Linux Yavuz!

  5. #5 by Mark - June 11th, 2008 at 12:09

    I am running MC on Fedora and displaying on WinXP.
    Setting UTF-8 worked perfectly.

    Thanks

  6. #6 by Mykola - June 12th, 2008 at 13:03

    thanks a lot it works!
    had same problem when connecting to the most of newest *nix.

  7. #7 by kurgbe - July 8th, 2008 at 11:17

    thank you for sharing your finding.

  8. #8 by Anonymous - October 7th, 2008 at 17:18

    it helped me find the answer quickly

  9. #9 by Anonymous - November 9th, 2008 at 10:16

    While this worked for me for Midnight Commander, now the line drawing of my kernel config (’make menuconfig’) is screwed over the same way MC was in non UTF-8 mode. :-P

  10. #10 by Tozzano - December 6th, 2008 at 13:57

    These settings work for me and mc.
    For my session in PuTTY:
    Terminal | Keyboard | The function Keys and Keypad : Linux
    Window | Translation | Received data assumed to be in which character set : ISO-8859-1(Latin-1)
    Connection | Data | Terminal-type String : xterm-color

    Line Drawing, Color, and the mouse works too :)

  11. #11 by viktor - December 28th, 2008 at 05:05

    Simple works, thanks a lot…

  12. #12 by Daze - January 29th, 2009 at 22:30

    For ArchLinux users, if you install the package mc-mp that takes care of the line drawing issues without the need for changing PuTTY settings. Not sure why. But it works.

  13. #13 by Anonymous - February 5th, 2009 at 15:03

    thanks buddy! that was really annoying

  14. #14 by Anonymous - February 22nd, 2009 at 02:22

    Create tip. Thanks!

  15. #15 by hdd - March 4th, 2009 at 16:36

    great tip!
    thanks!!!

  16. #16 by gertoth - March 21st, 2009 at 21:52

    Thank you for amazing solution. It works well with Ubuntu.

  17. #17 by Gustavo Benitez - May 3rd, 2009 at 17:03

    Muchas Gracias excelente solucion. Centos 5.2

  18. #18 by kris maxwell - May 30th, 2009 at 21:31

    Awesome- i love being able to find solutions like this so quickly.

  19. #19 by Tim van der Nagel - December 30th, 2009 at 15:22

    Thanks a lot for this easy fix!

  20. #20 by Fran - December 31st, 2009 at 15:21

    Thanks a lot!!!

  21. #21 by Scott Gutman - January 30th, 2010 at 18:39

    worked like a charm. thanks

  22. #22 by sean - February 4th, 2010 at 04:12

    awesome, I don’t know how many times that I’ve been faced with that mess, I should have looked a lot sooner :-) .
    Thanks for taking the time to post that

  23. #23 by Pedro - March 5th, 2010 at 15:08

    Thank you very much ;-)

(will not be published)
  1. No trackbacks yet.