broken layout in htop

When I run htop, I get a messed up layout, especially on the top section; you can see a sample here: https://i.stack.imgur.com/uVxp1.png

I’m running version 2.0.2, and this happens only on the terminals inside the graphical DE, not on the virtual tty’s accessed with CTRL+ALT+F1 and so on.

How can I solve this?

Set TERM to something else.

It’s caused by a change in ncurses, that uses a specific command for xterm now that most other terminal emulators don’t support.

See also:
https://lists.opensuse.org/opensuse-factory/2017-08/msg00440.html
http://bugzilla.opensuse.org/show_bug.cgi?id=1056020
https://bugs.kde.org/show_bug.cgi?id=384620
https://bugzilla.gnome.org/show_bug.cgi?id=787701