csh Cannot open /etc/termcap after starting "screen"
hans at beastielabs.net
Thu Jun 16 19:23:08 UTC 2011
On Thu, Jun 16, 2011 at 07:18:37PM +0200, Ivan Voras wrote:
> 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
> lara:/home/ivoras# setenv
> TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual terminal:\
> 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
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.
More information about the freebsd-stable