When connecting to the Pi by the serial console, I'd like to have the default TERM be xterm, rather than the current default of vt102:
pi@raspberrypi:~$ echo $TERM
vt102
pi@raspberrypi:~$ tty
/dev/ttyS0
I know I could add this to .bashrc, etc. - but I only want to change the current default, and to otherwise not impact other types of connections.
https://www.debian.org/releases/jessie/i386/ch05s03.html.en seems to indicate that I should be able to add TERM=xterm to the boot parameters - which are at /boot/cmdline.txt. As such, I tried updating the following:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
to:
dwc_otg.lpm_enable=0 console=serial0,115200 TERM=xterm console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
... and then rebooting, but with no change. Now, http://man7.org/linux/man-pages/man7/bootparam.7.html indicates that this may be a "(useless?) example" (for reasons I don't understand).
Now, I did find /lib/systemd/system/serial-getty@.service, which contains the following:
[Service]
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
... but I can't find where the default $TERM is being defined.
I did add the following here:
Environment=TERM=xterm
This is working - but it seems that I'm still missing part of the puzzle here, as to where this is defaulting to vt102, or why this can't be set in cmdline.txt.
(Other sources I've already referenced:)