TERM and SSH

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Jun 10 22:49:23 BST 2004


--ftEhullJWpWg/VHq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 10, 2004 at 09:26:57PM +0100, David Jenkins wrote:

> When I SSH from the FreeBSD machine to my Linux box (It's a=20
> Sparcstation, otherwise it would have  FreeBSD too ;)) and then say try=
=20
> editing a file with vi I get this error:
>=20
> vi: cons25: unknown terminal type.
>
> ... and vi won't start. At the remote prompt I then (using BASH)=20

Yes -- the terminal type 'cons25' is not recognised in the SysV world.
Which is a bit odd as cons25 is based on the standard console driver
found in SCO machines, and those are SysV to the core.

It's been a while since I looked at this, but I believe that SSH'ing
into Solaris machines you can use a terminal type of AT386
successfully -- but my memory is failing, and that type may not be
present in the Linux terminfo.

Another one to try would be 'ansi', except you'll usually need a 25x30 scre=
en
size, which isn't usual except as the FreeBSD console.

Failing that, you can extract the cons25 and related entries from
/etc/termcap and use the captoinfo(1) command on your Linux box to
generate a terminfo database entry for the cons25 terminal type.  See
eg.

    http://www.freebsd.org/cgi/man.cgi?query=3Dcaptoinfo&apropos=3D0&sektio=
n=3D0&manpath=3DRed+Hat+Linux%2Fi386+9&format=3Dhtml
=20
> export TERM=3Dvt100 or xterm (I've tried both)

All of the assumes you're using the FreeBSD console rather than
working from within X.  If you were ssh'ing to your Linux box from
within an xterm window on your FreeBSD desktop, then TERM=3Dxterm would
be the correct setting.
=20
> This allows me to open the file with vi but I cannot use the cursor keys=
=20
> (they print multiple characters to the screen).
>
> I have tried chaging cons25 in /etc/ttys to xterm or vt100 prior to=20
> SSHing but I still get the same problem.

That won't work unless you also recompile your kernel to expect the
console terminal to be a vt100 type -- see pcvt(4) and the commented
out section on the PCVT console driver in
/usr/src/sys/i386/conf/GENERIC -- however, I'd stick with the default
syscons(4) console.
=20
> Interestingly (and perhaps relevant !?), the problem does not exist when=
=20
> using the Windows SSH client PuTTY.

All Windows terminal emulation software tends to emulate a vt100 style
terminal by default.  Which is a terminal type that just about every
device or operating system you can access by ssh will be able to use.
The days of all sorts of weird and wonderful character based terminals
are long gone -- other than vt100/xterm, there's sometimes an option
somewhere to emulate an ANSI terminal, but that's not something I've
ever needed to use.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--ftEhullJWpWg/VHq
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAyNdjiD657aJF7eIRAoD0AKCKbOVCm4r15D0av4EOjFrQkovP3QCeNng1
ErhKITjseFx6kK8eF9alUGU=
=sKY5
-----END PGP SIGNATURE-----

--ftEhullJWpWg/VHq--




More information about the Ukfreebsd mailing list