Hacker News new | ask | show | jobs
by hpfr 1652 days ago
You're not getting old; this is a real nuisance.

That said, and to add onto the other reply, you're in luck: OpenSSH 8.8p1 includes support¹ for setting TERM in your SSH config with SetEnv². In my experience this works fine with just the client OpenSSH being up-to-date connecting to servers with older SSH versions and terminfo databases.

In your case, you might want to use a wildcard host at the end of your file to default to a more compatible TERM variable, and then override to foot's TERM variable value for the hosts you use that do have up-to-date terminfo:

    Host my-up-to-date-terminfo-host
      SetEnv TERM=foot
    
    Host *
      SetEnv TERM=xterm-256color
I've been using Foot for months now and just came across this issue, so it's nice there's now a path to get the full-fledged Foot experience only where it's supported. I usually stay comfortably inside GUI Doom Emacs for most shell workflows, but it's nice to have a modern, Wayland-native, no-nonsense terminal emulator when I do break my config :P.

¹ https://github.com/openssh/openssh-portable/commit/f64f8c00d...

² https://www.mankier.com/5/ssh_config#SetEnv

4 comments

Will this also work around a similar annoying problem with Kitty? Sorry I am not familiar enough with the workings of terminals to understand if that is the same type of problem.
It is the same issue, yes.
Just to add that if you share your homedir (or just your dotfiles) among hosts I think you should be able to copy a terminfo file containing the right terminfo stuff in your dotfiles and use the same setenv ssh config line to set the TERMINFO env var to point to that file.
Thank you! This is exactly what I've been looking for!
I remember trying this and it would get overwritten. Cool to see that OpenSSH is still seeing such careful maintenance.