Wed 14 Sep 2016 03:54:17 PM UTC, comment #8:
So I posted why we end up with "screen.xterm" or alike in previous comment.
I think it's more of discussion if we want screen to behave the way it is or force user input.
I would also assume that user input as long as it's correct takes precedence over how it behaves currently, so it should probably first check user passed value and if there is not corresponding termcap proceed with other checks.
And yes, reproduced it:
% echo $TERM
xterm-256color
% screen -c /dev/null -T screen
% echo $TERM
screen.xterm-256color
|
Wed 14 Sep 2016 03:42:39 PM UTC, comment #7:
char *
MakeTermcap(aflag)
int aflag;
{
char buf[TERMCAP_BUFSIZE];
register char p, cp, s, ch, tname;
int i, wi, he;
#if 0
int found;
#endif
if (display) ### Check if we are on tty
{
wi = D_width;
he = D_height;
tname = D_termname; ### here we get value from display (we are on terminal emulator like xterm), tname = "xterm"
}
else
{
wi = 80;
he = 24;
tname = "vt100"; ### here we use vt100, cause we aren't on terminal (for example when running screen from cron job)
}
debug1("MakeTermcap(%d)\n", aflag);
if ((s = getenv("SCREENCAP")) && strlen(s) < TERMCAP_BUFSIZE) ### check for user provided SCREENCAP
{
sprintf(Termcap, "TERMCAP=%s", s);
strcpy(Term, "TERM=screen"); ### Here we just set $TERM to screen
debug("getenvSCREENCAP o.k.\n");
return Termcap;
}
Termcaplen = 0;
debug1("MakeTermcap screenterm='%s'\n", screenterm);
debug1("MakeTermcap termname='%s'\n", tname);
if (*screenterm == '\0' || strlen(screenterm) > MAXSTR - 3)
{
debug("MakeTermcap sets screenterm=screen\n");
strncpy(screenterm, "screen", MAXTERMLEN); ### screenterm = "screen"
screenterm[MAXTERMLEN] = '\0';
}
#if 0
found = 1;
#endif
do
{
strcpy(Term, "TERM="); ### here wego and start setting $TERM, it's usual case (ie, we didn't bailout on SCREENCAP check above)
p = Term + 5;
if (!aflag && strlen(screenterm) + strlen(tname) < MAXSTR-1) ### if we are not attaching and we will fit into string
{
sprintf(p, "%s.%s", screenterm, tname); ### screenterm + '.' + tname; assuming above result is "screen.xterm"
if (e_tgetent(buf, p) == 1) ### we found terminal entry
break; ### so we break out of do loop
}
#ifdef COLOR
if (nwin_default.bce)
{
sprintf(p, "%s-bce", screenterm);
if (e_tgetent(buf, p) == 1)
break;
}
#endif
#ifdef CHECK_SCREEN_W
if (wi >= 132)
{
sprintf(p, "%s-w", screenterm);
if (e_tgetent(buf, p) == 1)
break;
}
#endif
strcpy(p, screenterm);
if (e_tgetent(buf, p) == 1)
break;
strcpy(p, "vt100");
#if 0
found = 0;
#endif
}
while (0); /* Goto free programming... */
|
Mon 05 Sep 2016 10:28:51 AM UTC, comment #4:
Hi,
I have found something interesting,
in Fedora (but I don't know, if only there or if is this presented even on other OS) we are not able to set terminal type to 'screen' only using -T parameter. Any other terminal value can be set without any problems.
Unfortunately, there is probably presented some heuristic (that is used for setting vt100 terminal type in case of nonsense terminal type is setted as -T parameter), which caused this issue. I am just don't know, if this heuristic is done by screen package or any other system service.
Any ideas?
Regards
Josef
|
Mon 22 Aug 2016 01:54:48 PM UTC, comment #3:
Hi again,
I have tried the screen version from git master branch.
Unfortunately, described problem persists for me.
I will compare screen package from Fedora with upstream version (4.4.0), just to find, if there wasn't problem with upgrade in Fedora.
If anybody have idea, where I should start, please leave comment here.
Thanks
Josef
|
Mon 22 Aug 2016 11:59:38 AM UTC, comment #2:
Hi,
I am using Fedora 24 64-bit, but unfortunately, this is my current output:
~$ echo $TERM
xterm-256color
~$ screen -T "screen"
~$ echo $TERM
xterm-256color
Second echo is used in screen window.
I will try it in git-master version of screen and I will let you know.
Regards
Josef
|
Mon 22 Aug 2016 07:16:38 AM UTC, original submission:
screen ignores the terminal type setting, either via the command line option -T or via the .screenrc setting "term". It always sets TERM=screen.xterm-256color, but this is incompatible when SSH-ing into older systems that don't have that terminal type defined.
Version-Release number of selected component (if applicable):
screen-4.4.0
How reproducible:
always
Steps to Reproduce:
1. screen -T screen
2. edit .screenrc, set "term screen"
3.
Actual results:
>env|grep TERM
TERM=screen.xterm-256color
Expected results:
>env|grep TERM
TERM=screen
|