Terminal – Alacritty Error: Terminal Entry Not Found in Terminfo

terminal

The errors

Terminal entry not found in terminfo

and

Error opening terminal: alacritty

happen to me on a legacy server when I ssh'ed to it like:

ssh MY_USER@MY_SERVER

and use Alacritty to open text files with vi MY_TEXT_FILE.

The following is just a warning that does not keep me from working with the file in vim, but starts with these lines whenever I look up a vim file:

E558: Terminal entry not found in terminfo
'alacritty' not known. Available builtin terminals are:
    builtin_amiga
    builtin_beos-ansi
    builtin_ansi
    builtin_pcansi
    builtin_win32
    builtin_vt320
    builtin_vt52
    builtin_xterm
    builtin_iris-ansi
    builtin_debug
    builtin_dumb
defaulting to 'ansi'

The other error Error opening terminal: alacritty. is worse since you cannot run some commands then, happens to me with htop to see all of the pids.

The two errors come up likely for the same thing. How to get rid of them?

Best Answer

This is taken from Nano/vim in SSH session respond with "Error opening terminal: alacritty." and other weird things. #3360 which then turned out to avoid the other E558: Terminal entry not found in terminfo as well.

Run:

TERM=xterm-256color

if you are already on the server.

Run:

TERM=xterm-256color ssh

if you want to make an environment variable already on your local machine that you want to pass to any ssh command.

Mind that you will use the terminal "xterm" then, which has less features than Alacritty. I use the xterm only for htop and top commands and other commands that do not accept Alacritty and throw 'alacritty': unknown terminal type. If you want to use Alacritty afterwards again, for example for the nice mouse-based copy feature so that you can copy more text than just what can be seen in the terminal page, see How to copy a large terminal history from Alacritty to the system so that I can search and document - the clipboard seems to get cut, change back to:

TERM=alacritty

I also get other terminals listed when I open a file in vim, mind that this is a legacy server.

Available builtin terminals are:
    builtin_amiga
    builtin_beos-ansi
    builtin_ansi
    builtin_pcansi
    builtin_win32
    builtin_vt320
    builtin_vt52
    builtin_xterm
    builtin_iris-ansi
    builtin_debug
    builtin_dumb
defaulting to 'ansi'

Thus, you might try those on your server, for example with the one to which it should default anyway:

TERM=ansi

Not all of the terminal names of the list work directly, for example, TERM=amiga does not work for me although it is built-in.