From owner-freebsd-stable@FreeBSD.ORG Thu Jun 16 19:23:07 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAEB0106566B; Thu, 16 Jun 2011 19:23:07 +0000 (UTC) (envelope-from hans@beastielabs.net) Received: from mail.beastielabs.net (beasties.demon.nl [82.161.3.114]) by mx1.freebsd.org (Postfix) with ESMTP id 735D38FC0A; Thu, 16 Jun 2011 19:23:07 +0000 (UTC) Received: from testsoekris.hotsoft.nl (localhost [127.0.0.1]) by mail.beastielabs.net (8.14.4/8.14.4) with ESMTP id p5GIxprU088122; Thu, 16 Jun 2011 20:59:51 +0200 (CEST) (envelope-from hans@testsoekris.hotsoft.nl) Received: (from hans@localhost) by testsoekris.hotsoft.nl (8.14.4/8.14.4/Submit) id p5GIxpHG088121; Thu, 16 Jun 2011 20:59:51 +0200 (CEST) (envelope-from hans) Date: Thu, 16 Jun 2011 20:59:51 +0200 From: Hans Ottevanger To: Ivan Voras Message-ID: <20110616185951.GA88009@testsoekris.hotsoft.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-stable@freebsd.org Subject: Re: csh Cannot open /etc/termcap after starting "screen" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 19:23:08 -0000 On Thu, Jun 16, 2011 at 07:18:37PM +0200, Ivan Voras wrote: > Hello, > > This *looks* like it should be a trivial problem (or at least > often-encountered one) but short of debugging both screen and tcsh, I > have no ideas what to do next... > > On several machines (seemingly random, some are running 7-stable, others > 8-stable), I get this message after starting "screen", written on the > newly created screen: > > csh: Cannot open /etc/termcap. > csh: using dumb terminal settings. > > The problem is: this also happens whan I'm doing it as the root user, > and /etc/termcap is a symlink to /usr/share/misc/termcap, which > definitely exists and is readable. To make it even stranger, it looks > like the environment contains something which seems to be valid termcap > data: > > lara:/home/ivoras# setenv > STY=58859.pts-13.lara > TERM=screen > TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual terminal:\ > :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\ > :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\ > :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\ > :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\ > :li#48:co#104:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\ > :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\ > :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\ > :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ > :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\ > :se=\E[23m:mb=\E[5m:md=\E[1m:mh=\E[2m:mr=\E[7m:\ > :me=\E[m:ms:\ > :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\ > :vb=\Eg:as=\E(0:ae=\E(B:\ > > :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\ > :k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:\ > :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\ > :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\ > :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:kb=^?:\ > :K2=\E[G:kh=\E[1~:@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:\ > :kP=\E[5~:kI=\E[2~:kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:\ > :kl=\EOD: > WINDOW=0 > SHELL=/bin/csh > > The shell and all started programs are misbehaving and/or treating the > terminal as "dumb". For example, "mc" writes this: > > lara:/home/ivoras# mc > Unknown terminal: screen > Check the TERM environment variable. > Also make sure that the terminal is defined in the terminfo database. > Alternatively, set the TERMCAP environment variable to the desired > termcap entry. > > There really isn't a termcap line in /etc/termcap beginning with > ^screen, but there is one beginning with ^SC containing the entry which > is also in the environment listing above (which fails with the same > error if I set it). > > The system works if I set some other terminal type like "xterm". > > Any ideas? Why is the "screen" terminal type so special? > This is probably because your termcap entry is too long. If I remember well the length is limited to 1024, which is confirmed by the following citation from 'man 5 termcap': The total length of a single entry (excluding only escaped newlines) may not exceed 1024. I have tried the TERMCAP entry you specified using bash and I get similar problems when using e.g. vi or clear. If I shorten the TERMCAP somewhat everything works again, though probably with reduced functionality. On 8.2-STABLE I can also set TERM to either screen or SC. Apparently the SC entry in /etc/termcap is just short enough. Hope this helps. Kind regards, Hans