TL/DR: You might be using a htoprc optimized for another device
- Delete your
~/.config/htop/htoprc
- Start htop on the computer with the most cores
- Get Layout 2
What's going on?
Supported by personal anecdotal evidence, this problem can also be caused by your htoprc
being tailored to a specific machine. The preferred layout is saved to .config/htop/htoprc
the first time you start htop. Or, more specifically, any time you close htop when there is no htoprc present. When you log into a machine using the same home folder (for example using LDAP) you still use the htoprc
from the fist time you launched htop.
In my case, I work on a terminal with 4 CPU cores (first launch, determined the layout) and can log into a compute server with 128 CPU cores (does look like your Layout 1). I couldn't even see the option tray, let alone use it (even with @mike's solution, which only generated two columns in my case). I was still using the same home folder and my htoprc was hence optimized for 4 Cores.
How to fix that?
By removing ~/.config/htop/htoprc
(or your local flavor of htop's config file), a new file is written on startup. This is optimized for the number of CPUs of the computer you currently work on. So make sure, you are logged into the device with the most cores (or the one which generates a layout you prefer).
For me personally, having four columns for the 4 core system looks a bit funny, but it beats not being able to see processes on the compute server.
Additional notes
The htoprc written automatically on the compute server was identical to perferming the replacement @mike suggested in my old config. However, I received two different layouts, none of them looked like the desired Layout 2. The diff of the config files was empty, so I guess the comment in the htoprc
# The parser is also very primitive, and not human-friendly.
is true, insofar as the parser is not human friendly ;)
F2
key configures display settings, and you may be able to change the output display format there. – Mukesh Sai Kumar Jan 13 '18 at 17:33