Subject: pkg/9161: ssh and TERMCAP environment variable
To: None <gnats-bugs@gnats.netbsd.org>
From: Richard Rauch <rkr@rkr.kcnet.com>
List: netbsd-bugs
Date: 01/10/2000 08:43:17
>Number:         9161
>Category:       pkg
>Synopsis:       ssh forwards TERM, but not TERMCAP
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 10 08:42:01 2000
>Last-Modified:
>Originator:     Richard Rauch
>Organization:
  "I probably don't know what I'm talking about."  --rkr@rkr.kcnet.com
>Release:        NetBSD/i386 1.4.1
>Environment:
	
System: NetBSD rkr.kcnet.com 1.4.1 NetBSD 1.4.1 (olibGENERIC) #3: Tue Nov 30 01:09:25 CST 1999 root@rkr.kcnet.com:/usr/src/sys/arch/i386/compile/olibGENERIC i386


>Description:
  When you ssh to another machine, your TERM variable is carried through.
  However, if your TERM corresponds to an entry in TERMCAP (e.g., if
  you are using window(1), or the screen package), you may well have your
  term-type rejected by the remote.

  You can manually install a TERMCAP variable remotely, of course.  Or,
  you can lie about your terminal type (this doesn't seem to get you very
  far if you are using window, but screen is more or less vt100-compatible.
  Your mileage may vary with other situations.)

  It seems to me to be a bug to forward TERM without at least conditionally
  carrying TERMCAP.

>How-To-Repeat:
  Start window or screen.
  ssh to a remote system.
  Very likely you will be told that your terminal type isn't supported,
  and you'll be forced to a ``dumb'' terminal.

>Fix:
  I offer only workarounds, here.  Probably it's not difficult to
  patch, but I don't want to mess with anything that is govered by both
  export laws and patents.  (^&

  According to ssh's man-page, you can modify /etc/environment to
  forward additional variables.  No information is given on how to
  do that (that's another send-pr to submit, I guess; technically
  a different problem).  Theoretically, that's one work-around.
  (What I tried, and which didn't work, was to put a single line,
  TERMCAP=$TERMCAP, in my /etc/environment.  It did no good.)

  You can manually carry over a TERMCAP definition.  (screen can
  even dump a termcap definition for you, allegedly.)

  You can lie about your terminal type (or accept relegation to ``dumb'').

  You can give up using window/screen.  (Those who lack virtual consoles
  and X support probably won't find this an appealing option.  And, I find
  window & screen preferable to virtual consoles (with a slight nod to
  window for ease-of-use).)
>Audit-Trail:
>Unformatted: