SSH headaches when using rxvt-unicode

As much as I love Manjaro i3 Community edition, it does cause me a fair amount of pain when it comes to SSH.  Being reasonable, this isn’t really the fault of the distro maintainer but the maintainers of rxvt-unicode I think.

If you’re a big user of SSH and ever log into CentOS/RHEL systems then you probably already know what I’m talking about.

The Problem

You SSH into a CentOS/RHEL system and find you can’t clear the screen (Ctrl + l) and you can’t use less properly.

Can’t use vim properly

On the remote host you can’t use less properly.

[[email protected] ~]# less original-ks.cfg 
WARNING: terminal is not fully functional
original-ks.cfg  (press RETURN)

Can’t clear the terminal

On the remote host you can’t clear the terminal.

[[email protected] ~]#
[[email protected] ~]# clear
'rxvt-unicode-256color': unknown terminal type.
[[email protected] ~]#
[[email protected] ~]#

The Solution

I really don’t have the long term solution here should be and personally I don’t feel this is something I should have to worry about.  Regardless of who should fix it, until they do, here are a few of the method I use depending on the situation.

Change TERM on local machine

This is probably the easiest solution as there is no configuration on the remote host to do.

[[email protected] ~]$ echo $TERM
rxvt-unicode-256color
[[email protected] ~]$ TERM=xterm-256color
[[email protected] ~]$ ssh [email protected]
[[email protected] ~]# clear

To use this method, you’ll have to make it permanent by adding export TERM=xterm-256color to ~/.bashrc.

[[email protected] ~]$ echo 'export TERM=xterm-256color' >> ~/.bashrc
[[email protected] ~]$ source ~/.bashrc

You could also make the same change on the remote host but that might be a problem if you’ve got a lot of RHEL machines to administer for example!

Install rxvt-unicode-256color term info on remote host

[[email protected] ~]$ ssh [email protected] 'mkdir -pv ~/.terminfo/r'
[[email protected] ~]$ scp /usr/share/terminfo/r/rxvt-unicode-256color [email protected]:.terminfo/r
[[email protected] ~]$ ssh [email protected]
[[email protected] ~]# clear

Install rxvt-unicode on remote host

For this to work the EPEL repository (epel-release) needs to installed first.

[[email protected] ~]# yum install epel-release
[[email protected] ~]# yum install rxvt-unicode

Not ideal but hopefully with the above information you can figure something out that works for you. At least until someone somewhere fixes this issue! 😉

Be the first to comment

Leave a Reply