15

I work on a NetBSD system through an ssh connection from my Mac and I want to use the screen utility so that I can start processes and come back to them after my terminal connection has been interrupted. When I type screen I get the error message:

Cannot find termcap entry for 'xterm-256color'

After looking through forum posts, I thought it had something to do with termcap on the remote machine, but that appears not to be the case; I can initiate screen with no errors from an ssh session from another computer, one to which I don't generally have access. This suggests that I need to configure something on my local machine, but I haven't been able to figure out what or how. Although this post is tagged "gnu-screen" I suspect that I'm working with Berkeley screen, though I don't know whether that is a significant distinction.

3 Answers 3

34

Quick fix: run TERM=xterm screen instead of screen.

You get the error because on your mac you have TERM=xterm-256color, and xterm-256color is not in the remote machine's termcap. You don't get the error when you connect from the other computer because it has its TERM variable set to something else.

3
  • That makes sense, and raises two questions: (1) are any side-effects expected from running TERM=xterm screen?; (2) how can I install xterm-256color in my account on the remote machine such that it will be found?
    – Gregory
    May 30, 2012 at 21:28
  • (1) You might not be able to use your terminal window's full capabilities (if you find yourself unable to use colour, try running TERM=xterm-color screen instead). (2) I have no idea. I suggest asking on SuperUser.com or ServerFault.com.
    – dave4420
    May 30, 2012 at 22:36
  • The only side effect of using xterm (or xterm-color) instead of xterm-256color is that any console app that can handle 256-color text will fall back to 16-color instead text instead. Usually not worth worrying about, but if it matters, you will have to get the right termcap onto the remote machine, as dave4420 says.
    – abarnert
    May 30, 2012 at 23:46
6

You can add it personally to $HOME/.termcap - run this on your NetBSD account:

infocmp -C xterm-color | sed -e 's/xterm-color/xterm-256color/' > $HOME/.termcap

But you can also as root (or ask root) to add the termcap entry to /usr/share/misc/termcap. That would fix it for all users.

3

In OS X, under the tab Profiles, then Advanced, then Terminfo, switch from xterm-256color to xterm.

Terminal Settings

1
  • If using iTerm the equivalent setting is under iTerm2>Preferences>Profiles>Terminal
    – Ed Randall
    May 23, 2017 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.