How to Fix htop Frozen or Unresponsive?

When the htop interactive process viewer freezes or becomes completely unresponsive in a Linux terminal, it typically indicates that the terminal emulator has intercepted a control signal, the SSH session has dropped, or the system is experiencing severe resource exhaustion. This article provides a quick troubleshooting guide to help you safely force-quit a frozen htop session, recover your terminal functionality, and diagnose the underlying cause of the system lockup without needing to reboot your entire machine.

Step 1: Break the Terminal Lock with Keyboard Shortcuts

Before closing your terminal window entirely, try using standard Linux signal shortcuts to regain control. Sometimes the interface is just paused rather than completely broken.

Step 2: Terminate htop from a Second Terminal Session

If keyboard shortcuts fail, the htop process itself is likely stuck in an Uninterruptible Sleep state (D state) or your terminal session is completely dead. You will need to open a secondary terminal window or connect via a new SSH session to kill the process.

First, find the Process ID (PID) of your frozen htop instance using the pgrep command:

pgrep htop

Once you have the PID, attempt to terminate it gracefully using the SIGTERM signal:

kill <PID>

If the process still refuses to close, force it to shut down immediately by sending the SIGKILL signal:

kill -9 <PID>

Step 3: Recover a Glitched Terminal Screen

Sometimes htop dies but leaves your terminal emulator in a broken state where your cursor is missing, text formatting is corrupted, or typed characters do not appear on the screen.

To fix this, simply type the following command in the affected terminal and press Enter:

reset

This re-initializes the terminal state, clearing the screen buffer and restoring normal text inputs.

Common Causes of htop Freezes

Understanding why htop froze can help prevent it from happening again in the future: