How to fix 'unknown terminal type' error when Ghostty logon AWS EC2

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
2
3
4
5
6
7
8
9
10
11
12
[ec2-user@ip-10-215-240-19 ~]$ tic -x /tmp/ghostty.terminfo
"/tmp/ghostty.terminfo", line 2, col 31, terminal 'xterm-ghostty': older tic versions may treat the description field as an alias

[ec2-user@ip-10-215-240-19 ~]$ pwd
/home/ec2-user

[ec2-user@ip-10-215-240-19 ~]$ find .terminfo/
.terminfo/
.terminfo/x
.terminfo/x/xterm-ghostty
.terminfo/g
.terminfo/g/ghostty

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.

Contents