Popular Ghostty Terminal https://ghostty.org/ from it to logon AWS EC2 instance, “unknown terminal type“ thrown on EC2.
On Ghostty Terminal host:
1 | $ infocmp -x > /tmp/ghostty.terminfo |
Then copy Ghostty terminal info file across over to EC2 instance:
1 | $ scp ghostty.terminfo ec2-user@i-0012f794e5fabcdef:/tmp |
Logon EC2 instance, and run:
1 | [ec2-user@ip-10-215-240-19 ~]$ tic -x /tmp/ghostty.terminfo |
Why This Happens
Ghostty uses TERM=xterm-ghostty which requires a terminfo entry on the remote system. Older Linux servers/macOS servers simply don’t have that entry in their terminfo database, so the other terminal utilities throw this “unknown terminal type“ error.
SAME issue also happens when run asitop in Ghostty. Error thrown:
1 | 'xterm-ghostty': unknown terminal type. |
This is because asitop (via the blessed library) doesn’t recognize Ghostty‘s terminal type xterm-ghostty.
Either run as:
1 | TERM=xterm-256color sudo asitop |
or, add an alias to the shell config (~/.zshrc or ~/.bashrc):
1 | alias asitop='TERM=xterm-256color sudo asitop' |
Ghostty uses xterm-ghostty as its $TERM value, which isn’t in the terminfo database that blessed checks against. Falling back to xterm-256color gives it a fully compatible terminal description while keeping all the color/formatting support asitop needs.