You can fix this by setting the following values in .config/alacritty/alacritty.yml:
env:
TERM: xterm-256color
Another way is described here: https://wiki.archlinux.org/title/Alacritty#Terminal_function...