Jump to content

ncurses under ssh/PuTTY - messed up horizontal spacing


hello_world.c

Recommended Posts

OPiPC2, with Armbian Bionic
desktop mainline based kernel 4.19.y

 

Using it as headless server, all X and desktop stuff removed. Using PuTTY to log in via SSH, line drawing stuff (as usual) only works if translation is set to ISO-8859-1 in PuTTY.

 

mc looks great, but all ncurses-based software (aptitude, htop, bmon etc) does not. Main problem seems that horizontal spacing is "shrunk" whenever there is no text to keep it:

 

image.png.ad875418c9763d586c86b348401f6f8d.png

 

This is even more dramatic for menu systems and anything that is column-oriented. Tried dpkg-reconfigure locales to switch system to ISO-8859, but no change, really seems to be an ncurses bug. No such problems with other systems (Raspbian etc.).

 

Is this a known problem? Is there a workaround?

 

Thanks

Link to comment
Share on other sites

40 minutes ago, hello_world.c said:

Thanks, but with this, now mc also doesn't show line drawing characters, and spacing in ncurses is still wrong.

OK ;)

from your apt-picture above it looks like you are NOT using a mono-font (every character the same width) so the spaces in your borders are to thin, because the space character isnt such as wide as a normal letter or sign.

for PuTTY I do use the mono-font Cousine (TTF format):
https://github.com/google/fonts/tree/master/apache/cousine
https://fonts.google.com/specimen/Cousine

https://www.1001freefonts.com/cousine.font

With the follwoing settings in armbian-config => Personal => Locales

and the following PuTTY-Settings I do get a good picture with lines - also in mc (Midnight Commander) :)

 

So you try my settings and tell me if it is getting better ;)

 

 

aconfig_locales_UTF8.jpg

mc.jpg.89e421081e68abce9e0f7638cbae58b5.jpg

aptitude.jpg.50461e3b20175600dbc37433ae370d02.jpg

putty_font.jpg

putty_translation.jpg

Link to comment
Share on other sites

My PuTTY font is Courier New which is monospace. I don't have Cuisine, but tried Consolas, same result.

 

With your exact settings, mc looks fine, but armbian-config does not:

 

image.png.bd34e7cd18293f6d4282a3b48cdbe54a.png

 

No ncurses program (bmon, aptitude) shows ncurses line drawing characters when I choose UTF in PuTTY. Aptitude menu apparently is not ncurses and works like mc does:

image.png.b06deec7aa358d112ab27aa4b69cefe0.png

but the dialogs seem to be ncurses so doesn't work:

image.png.083548e3c13c6a6394951395aec0bb71.png

 

With ISO translation in PuTTY, it's the opposite: mc is not showing line drawing:

image.png.96ca3397d6497721f235e1a9a402d884.png

 

but armbian-config (kind of) works, well, without background completely filled:

image.png.883fbe869871bff7ec0792d99b4d3c42.png

 

In aptitude, as expected, dialogs work:

image.png.27f8bb8c9f6924cc71b1991f709bb362.png

but menu doesn't:

image.png.cbc0155de561d17f58fc350c92a6f1f6.png

 

This is sooo messy... :-(

 

Link to comment
Share on other sites

did you use/set UTF8 in armbian-config locales?

did you remove the LC_ALL=C ?

and all after that reconnect via SSH to get the new setting?

 

I also got these q's as border when I didnt used UTF8 in PuTTY and armbian-config/locales at the same time (and when LC_ALL=C was also active)

LC_ALL_UTF8.jpg

Link to comment
Share on other sites

new login after setting armbian-config to en_US.UTF-8?

the black text background looks strange.

maybe I have to read more about ncurses? :(

 

you did click apply in PuTTY (then its only for the actual session) or you save it to you actual session (first entry in  change settings)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines