Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Weird text linedraw issue; PuTTY + Unicode
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Tue Jul 08, 2014 7:20 pm    Post subject: Weird text linedraw issue; PuTTY + Unicode Reply with quote

Summary: Midnight Commander linedraw chars rendered as q's and x's under PuTTY when UTF8 is enabled, but fine in local console and also if PuTTY is not set to UTF8


Hi all,

Just got SSH sorted out on my new build, got a weird issue with things like mc and make menuconfig - The linedraw chars render perfectly everywhere EXCEPT with PuTTY+UTF8, where they appear as mostly x's and q's.

This ONLY happens with PuTTY+UTF8; If I set the PuTTY translation to something else, e.g. ISO-8859-1, the linedraw chars render fine!

I suspect it is a terminfo or termcap problem as if I do e.g. <code>TERM="linux" mc</code> then linedraw chars are rendered correctly. The TERM PuTTY normally exports is "xterm".

This all works fine on my old server but I can't see what's different...!
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Wed Jul 09, 2014 5:48 pm    Post subject: Re: Weird text linedraw issue; PuTTY + Unicode Reply with quote

I think you are on the right track and I remember to have had that same issue in yast under SuSE (BTW with hindsight I can only attribute SuSE to youthful folly before I found out about gentoo, the one and only distribution).
Cyker wrote:
I suspect it is a terminfo or termcap problem as if I do e.g. <code>TERM="linux" mc</code> then linedraw chars are rendered correctly. The TERM PuTTY normally exports is "xterm".

If I recall correctly the change required was within putty under the "Connection->Data" Category where the field "Terminal-type string" needed to be changed to a value of "linux".

After that I did not have any further issues if under the "Window->Translation" Category the "Remote character set" was set to "UTF-8".

Over and above this I also use a different font named "DejaVu Sans Mono" but I seem to remember that this change was not required for UTF-8 to wotk. My change of font was mainly triggered by tha fact that this font is not only easily readable but also clearly distinguishes between both "1" (the digt "one") and "l" (a lowercase "L" character as in "love") and also between "0" (the digit "zero") and O (the uppercase character "O" as in "Oslo").

In case that does not work out, I'd suggest we compare our settings in putty side by side to work out the differences.

Regards,

Atom2
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Jul 10, 2014 3:16 pm    Post subject: Reply with quote

Is there a way of decompiling/editing/comparing terminfo entries?

I'm trying to figure out why my older server doesn't have this problem, while the new one does!

Times like this make me miss my Slackware days back when termcap entries were human-readable text instead of all these unreadable binary formats!
Back to top
View user's profile Send private message
Atom2
Apprentice
Apprentice


Joined: 01 Aug 2011
Posts: 185

PostPosted: Thu Jul 10, 2014 3:46 pm    Post subject: Reply with quote

Cyker wrote:
Is there a way of decompiling/editing/comparing terminfo entries?

There are two programs, one to compile called
Code:
tic - the terminfo entry-description compiler
and the opposite named
Code:
infocmp - compare or print out terminfo descriptions
the latter being what you are looking for. BTW infocmp does only require the name of the terminfo file, not its full path.

linux terminal capabilities:
Code:
#       Reconstructed via infocmp from file: /etc/terminfo/l/linux
linux|linux console,
        am, bce, ccc, eo, mir, msgr, xenl, xon,
        colors#8, it#8, ncv#18, pairs#64,
        acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
        bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l\E[?1c,
        clear=\E[H\E[J, cnorm=\E[?25h\E[?0c, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        cvvis=\E[?25h\E[?8c, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
        dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
        el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H,
        hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
        il=\E[%p1%dL, il1=\E[L, ind=^J,
        initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
        kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
        kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,
        kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
        kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
        kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~,
        kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,
        kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
        kmous=\E[M, knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, oc=\E]R,
        op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m,
        rmam=\E[?7l, rmir=\E[4l, rmpch=\E[10m, rmso=\E[27m,
        rmul=\E[24m, rs1=\Ec\E]R, sc=\E7, setab=\E[4%p1%dm,
        setaf=\E[3%p1%dm,
        sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
        sgr0=\E[0;10m, smacs=\E[11m, smam=\E[?7h, smir=\E[4h,
        smpch=\E[11m, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
        u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c,
        vpa=\E[%i%p1%dd,


xterm terminal capabilities:
Code:
#       Reconstructed via infocmp from file: /etc/terminfo/x/xterm
xterm|xterm terminal emulator (X Window System),
        am, bce, km, mc5i, mir, msgr, npc, xenl,
        colors#8, cols#80, it#8, lines#24, pairs#64,
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
        clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
        dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K,
        flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG,
        ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
        ind=^J, indn=\E[%p1%dS, invis=\E[8m,
        is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~, kEND=\E[1;2F,
        kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~,
        kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H, kcbt=\E[Z,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
        kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
        kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q,
        kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~,
        kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~,
        kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
        kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
        kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~,
        kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~,
        kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q,
        kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~,
        kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~,
        kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
        kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q,
        kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
        kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~,
        kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~,
        kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
        kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~,
        kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
        kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El,
        memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
        rin=\E[%p1%dT, rmacs=\E(B, rmam=\E[?7l, rmcup=\E[?1049l,
        rmir=\E[4l, rmkx=\E[?1l\E>, rmm=\E[?1034l, rmso=\E[27m,
        rmul=\E[24m, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
        setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
        setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
        setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
        sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
        sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smcup=\E[?1049h,
        smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m,
        smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n,
        u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd,


To be perfectly honest, I have not done any comparision (other than the obvious fact that the xterm entry contains much more data; also the binaty file is much larger on my system) and without further investigation, I would also not really know what to look for or where to start ...

I nevertheless hope that helps,

Atom2
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Jul 10, 2014 9:21 pm    Post subject: Reply with quote

Thanks mate, genius! :D

The infocmp is what I was after! However, rather than bring us closer to an answer it is just created more questions!!

I thought we might be on to something as the terminfo files are different sizes:

Old server:
Code:
-rw-r--r-- 1 root root 3258 Apr 16  2011 /etc/terminfo/x/xterm


New server:
Code:
-rw-r--r-- 1 root root 3270 Jul  5 23:47 /etc/terminfo/x/xterm



However, when I infocmp'd them and stripped out the leading whitespace indents, diff reports they are identical!!!

There must be something else in play here...
On my old server, I tried "TERM=[xterm,rxvt,rxvt-unicode,linux] mc" - ALL of them render linedraw characters correctly.

On my new server, ALL of them draw with the x's and q's EXCEPT TERM=linux!!!

Waaaaaaaa??!
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Jul 10, 2014 9:29 pm    Post subject: Reply with quote

Well I tried /usr/src/linux$ make menuconfig and they both old and new go xxxxx qqqqqq so clearly I never fixed the problem on the old server; I must have implemented some sort of hack specifically for midnight commander??
Back to top
View user's profile Send private message
Cyker
Veteran
Veteran


Joined: 15 Jun 2006
Posts: 1746

PostPosted: Thu Jul 10, 2014 9:43 pm    Post subject: Reply with quote

Aha!

I was reading back through my emerge notes on my old server (First Rule of Gentoo - DOCUMENT EVERYTHING YOU DO!), and it turns out the way I 'fixed' mc was to compile it with slang instead of ncurses!

Just tried it and waddayaknow, it works!:D :D :D No more x's and q's!

Doesn't help in anything that uses ncurses, but since mc is the only thing I really use in the console that uses linedraw, that'll do me!


Thanks man, having someone to bounce ideas off really helped! I don't think I would have tried this other path without your help confirming it wasn't terminfo!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum