Unix screen utility error: Cannot find termcap entry for 'xterm-256color'
Asked Answered
I

3

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.

Installment answered 30/5, 2012 at 20:45 Comment(0)
A
35

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.

Arrester answered 30/5, 2012 at 21:12 Comment(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?Installment
(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.Arrester
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.Aeneas
I
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.

Iives answered 27/8, 2013 at 1:40 Comment(0)
H
3

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

Terminal Settings

Henn answered 28/3, 2015 at 19:10 Comment(1)
If using iTerm the equivalent setting is under iTerm2>Preferences>Profiles>TerminalLudivinaludlew

© 2022 - 2024 — McMap. All rights reserved.