# Termcap database issues



## hjf (Nov 6, 2022)

Hello. I'm running 13.1-RELEASE. Last night I was trying to enable colors for my Windows client (PuTTY) and when trying to run anything, I got the message about putty-256color not being a valid terminal. So I tried adding it to /etc/termcap and running cap_mkdb, and after that, my system is ruined. 

Pretty much every program I want to run (over ssh) says it can't access the termcap database. For example, zsh says:


```
Cannot read termcap database;
using dumb terminal settings.
```

bash, csh, and others say similar messages.

echo $TERM says "xterm"

I tried the following:


removed the putty-256color entry
ran cap_mkdb /etc/termcap
deleted /etc/termcap.db
cd /usr/local/share/misc && cap_mkdb termcap
chmod 666 termcap*
cd /usr/src/share/termcap && make install
recreated the link from /usr/local/share/misc/termcap to /etc/termcap
installing ncurses
uninstalling ncurses
installing screen, tmux, bash, zsh, csh to see if they try to cap_mkdb properly
I'm not really sure what the problem is


----------



## W.hâ/t (Nov 6, 2022)

Remove the 'TERM=' line in your shell startup files


----------



## hjf (Nov 6, 2022)

There is no TERM line in any of my rc files, or in .profile, but still, this sounds like it'll just treat the symptom but not fix the problem?

This system worked like this for over 10 years.


----------



## covacat (Nov 6, 2022)

do you have a TERMCAP or TERMPATH entry in your env ?


----------



## hjf (Nov 6, 2022)

covacat said:


> do you have a TERMCAP or TERMPATH entry in your env ?


I didn't have one but when googling for info on that I noticed that by default it will search for ~/termcap, /etc/termcap, and /usr/share/misc/termcap

The problem is that I had a bad ~/termcap.db. I deleted it and it all works now!


----------

