UI broken in Ghostty terminal (xterm-ghostty not recognized)
When running asitop inside Ghostty, the UI does not render properly compared to macOS Terminal.app.
Instead of the expected bordered/graph layout, large sections of the interface appear empty or misaligned.
Ghostty sets $TERM to xterm-ghostty, which blessed (the library asitop uses) seems unable to recognize.
Steps to Reproduce
- Install Ghostty terminal emulator
- run
sudo asitop
Expected Behavior
UI should render properly (as in Terminal.app, iTerm2, etc.), with all borders and graphs visible.
Actual Behavior
Warning is shown:
'xterm-ghostty': unknown terminal type.
UserWarning: Failed to setupterm(kind='xterm-ghostty'): setupterm: could not find terminal
Environment
-
macOS 15.6.1
-
Chip: Apple M3 Pro
-
asitop: 0.0.24 (brew install asitop)
-
Python: 3.13
-
Ghostty: V1.1.3
Screenshot
Below screen shot shows the difference in both Terminal.app and Ghostty side by side
As a quick fix, just delete the /tmp/asitop_powermetrics[XXX] file. I use sudo rm -f /tmp/asitop_powermetrics[XXX] (make sure to replace XXX) with the actual filename.
Fix: TERM=xterm-256color sudo asitop
Or
Put : term = xterm-256color
in your ~/.config/ghostty/config file.
Mine shows like this now: