Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does Alacritty still require you to copy terminfo to remote servers in order for backspace to work? I loved Alacritty, but copying terminfo every time gets old pretty quickly.


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...


Setting TERM this way causes other subtle problems your local host. Instead I set `alias ssh="TERM=xterm-256color ssh"` which works pretty well.


What kinds of subtle problems?


Awesome, thanks for the tip!


ncurses/terminfo is pretty fundamentally broken for the modern SSH/Tmux use-case.

For example a few years ago I tried to enable 24-bit ("truecolor") support...

For one thing, the terminfo reporting for 24-bit color support wasn't universally recognized: terminfo added an 'RGB' capability to report this, but because this was added only "recently" (as far as terminals are concerned), not all programs relied on it. For example, Emacs or Vim didn't seem to use this capability.

For another thing, there can be a mismatch between what the local and remote terminfo databases (provided by ncurses) support in terms of recognized capabilities. I had tried to copy the xterm-direct terminfo to the remote, but it wasn't recognized! Turned out it had to be compiled with the remote server's tic.

Supposedly the Terminals Working Group [1] was looking into overhauling the ancient terminfo system to support this, but there was no clear path forward. I suppose one of the problems is the massive backwards-compatibility requirement. (There is probably nothing else in the software ecosystem that requires such backwards compatibility as terminals, they literally trace their ancestry to the 19th century! [2] )

[1] https://gitlab.freedesktop.org/terminal-wg

[2] https://en.wikipedia.org/wiki/Teleprinter


I should add that TermInfo databases, still present in Linux & macOS system today, are really interesting to compare with modern configuration systems. Nowadays we have no problem using verbose formats like TOML, JSON, YAML, or XML (plists!), because our computers are fast, have lots of storage and memory! We've traded efficiency for convenience.

Terminfo is a remnant from when computers were slow and disk/memory constrained, and it made every byte count. It was hard to efficiently encode a database of all the capabilities of the terminals at the time! The trade was in favor of efficiency at the expense of convenience.

Look up the manpage for tic, toe, infocmp & family.


alacritty's default terminal is indeed still quite foreign to most machines but it can fallback to xterm compatibility by overriding the TERM variable in your alacritty.yml:

  env:
    TERM: xterm-256color


short-term: Add the terminfo file to your vm provisioning tooling: ansible, terraform, etc

long-term: Maintain an alacritty package in your distro of choice so the terminfo is automatically included


I can just imagine me chatting with devops people:

- Hi Jeff, I know you have a todo queue from here till the next century, but please add one more item, having all our VMs, however they built, to include this set of files. I need it ASAP since without it if I log in to a server, I can't use backspace.

- What? Why? This looks like lots of work to modify each one of our 10000 deployments. It also may create some bugs and using non-standard deployment packages is time-consuming. What's wrong with plain old ssh, it works everywhere? What's wrong with your backspace, maybe I should order you a new keyboard?

- Well, ssh is fine but you see, I've got this new OpenGL super-fancy terminal emulator, and if I use it to ssh into a random server my backspace doesn't work. So if you changed every deployment we have to support it, that would be great, mmmkay? Oh and longer term I also need you to maintain a custom package for every linux distribution we might use that fixes this issue.

- Are you high? Did you check you temperature lately - maybe you have a high fever and your mental capacities are compromised?

- Hold on, Jeff, don't you think me using a fancy terminal program than can scroll 35% faster worth the effort? And it's also written in Rust! You could use it too, it's really awesome unless you need the backspace key for some weird reason.

- clickety click I've disabled all your shell access to all our servers until your mental health improves, and asked HR to issue you a week of sick days. Please get well soon.


Sometimes we have to deal with VMs admin'd by other people.


i haven’t observed that behavior at any time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: