The "top" command does not display output when executed through SSH on Ghostty
System details
Omarchy v3.2.0
What's wrong?
I had the issue where top would return without output when executed through SSH. After searching a bit, I found some solutions here:
https://ghostty.org/docs/help/terminfo https://github.com/ghostty-org/ghostty/discussions/8984
Executingexport TERM=xterm-256coloron the remote machine would resolve it. Alternatively locally:
# .ssh/config
Host example.com
SetEnv TERM=xterm-256color
or in order to automate this ( taken from the link above) :
shell-integration-features = ssh-terminfo to copy the terminfo entry the first time you log into a new server over SSH.
shell-integration-features = ssh-env to configure SSH to fall back to xterm-256color.
If both features are enabled (shell-integration-features = ssh-terminfo,ssh-env), Ghostty will try to install the terminfo entry first and use the fallback if installation failed.
Recommendation for the best default, @mitchellh?
+1 on this. top fails silently (no output) for me too, while commands like clear throw the unknown terminal type error.
I'm currently using this workaround in ~/.config/ghostty/config: term = xterm-256color