Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I use "htop" command for linux (+F5), layout on 2 my vps different:

First server Second server

Why on my first server I see broken tree?

share|improve this question

It's probably to do with your terminal on the vps server. You can check your terminal with

env|grep -i term

They are probably different.

edit 1

and do you have one of those in terminfo database ?

ls -l /lib/terminfo/x/

edit 2

Well different distributions can locate them at different locations. documentation can be read,

man 5 terminfo

less /etc/terminfo/README

man infocmp

share|improve this answer
Same answer on both servers: TERM=xterm – SPnova Mar 16 '14 at 8:50
On one my server(correct) I see correct listing: [total 36] But on my another (incorrect) server I see: [No such file or directory] Correct file on this server in another directory: [ls -l /usr/share/terminfo/x] Should I copy this file to [/lib/terminfo/x/] folder and reboot server? – SPnova Mar 16 '14 at 9:32

I'd interrogate the tool you're using to connect to these servers. This definitely looks like a terminal display issue, and since you're saying the environment variable TERM=xterm is being set identically on both, I'd make sure the options on your terminal emulator are also set consistently.

share|improve this answer

This is related to another which I answered recently, but the accepted answer in that case is unsuitable:

terminal: displaying special characters

The first screenshot clearly shows htop being run on a terminal where UTF-8 encoding is not supported, because the misdrawn text should be line-drawing characters. The latter shows it using ASCII characters to imitate line-drawing characters.

The setting of TERM is irrelevant, because htop does not use the terminal description to decide how to draw lines. It uses your locale environment variables to choose between two hardcoded schemes for drawing lines. It uses the nl_langinfo call in this ifdef:

   if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
      CRT_utf8 = true;
      CRT_utf8 = false;

to decide (based on LC_ALL, LC_CTYPE, etc.), that your terminal supports UTF-8 and is configured to do this.

Further reading:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.