TERM and SSH

David Jenkins jaco2001uk at ntlworld.com
Thu Jun 10 23:24:23 BST 2004


Matthew Seaman wrote:

>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 
>>Sparcstation, otherwise it would have  FreeBSD too ;)) and then say try 
>>editing a file with vi I get this error:
>>
>>vi: cons25: unknown terminal type.
>>
>>... and vi won't start. At the remote prompt I then (using BASH) 
>>    
>>
>
>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 screen
>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=captoinfo&apropos=0&sektion=0&manpath=Red+Hat+Linux%2Fi386+9&format=html
> 
>  
>
>>export TERM=vt100 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=xterm would
>be the correct setting.
> 
>  
>
>>This allows me to open the file with vi but I cannot use the cursor keys 
>>(they print multiple characters to the screen).
>>
>>I have tried chaging cons25 in /etc/ttys to xterm or vt100 prior to 
>>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.
> 
>  
>
>>Interestingly (and perhaps relevant !?), the problem does not exist when 
>>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
>
>  
>
Thanks for the reply Matthew.

After reading your advice I found this:
http://www.mail-archive.com/freebsd-questions@freebsd.org/msg11703.html

Which basically says to copy the cons25 terminal descriptions from the 
FreeBSD --> Linux box?

I hope I'm not being too stupid but how exactly would I go about doing 
this because after reading /etc/termcap there seem to be an awful lot of 
references to cons25(*).
i.e.
cons25w
cons25-m

etc ...

I assume they are all related and that each depends on the other??

Do I need to create a file with all of these in?

Thanks for your help and time.

David




More information about the Ukfreebsd mailing list