The Pragmatic Addict

Change the terminal type in your serial console

Background

If you’ve read my previous articles, you know I love to manage my linux computers through their serial console. For the most part it works until you get into curses/TUI interfaces. After a bit of digging, Debian uses a vt220 terminal (changed from vt100). In most consoles this wouldn’t be an issue. However when using conman the terminal is inherited from the shell you are running at the time, in my case xterm.

Find out what terminal emulation you are using.

There are a couple ways to do this. This is important to find out what term your shell program is running before using conman. Also important when you connect to the console to see what it’s setup for.

echo $TERM

printenv | grep TERM

Change your server’s serial console TERM

This is the piece of code you need to insert:

[Service]
Environment="TERM=xterm"

This can be done with with the edit command to set the TERM on ALL serial ports:

systemctl edit serial-getty@.service 

OR, specifiy a specific port:

systemctl edit serial-getty@ttyAMA0.service 

The resulting file can be found in:
/etc/systemd/system/[service name].d/override.conf

Commit the changes to the system and restart the service

systemctl daemon-reload
systemctl restart [service name]

Created: 2026-01-02 Modified: 2026-01-02