Discussion:
Screen - Please set a terminal type
bjallefix
2005-09-25 17:02:22 UTC
Permalink
Hi.

I have just bought a NSLU2. I'm new to Linux, and I could really need
some help with the screen utility.
I installed screen v4.0.2-2 with ipkg. Do I have to create/modify a
configuration file as well?

On the NSLU2 web site it is descibed an example use with ctorrent
(which is exactly what I want), but if I just write screen ctorrent
<torrent.file> I get the "Please set a terminal type" message and
nothing more happens. The same happens regardless to which application
I try to start.
I have tried the different switches, and if I type screen -d -m
ctorrent <torrent.file> it starts a new screen process and detatches.
I can do a screen -list to verify that the process i alive. BUT I can
NOT attach to it with the -r switch...

I would be very happy if someone could help med. I'm running my slug
on unslung 5.5beta

Regards,
Bjarte







------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
mbanditt
2005-09-25 18:34:33 UTC
Permalink
Try

export TERM='vt100'

before starting screen.

If it works, you need to define it within a diversion script.

Cheers,

Michael




------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Lennert Buytenhek
2005-09-25 18:35:44 UTC
Permalink
Post by mbanditt
Try
export TERM='vt100'
before starting screen.
But this is a property of the terminal (i.e. the SSH client),
and not of the slug..


--L


------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
mbanditt
2005-09-25 19:36:04 UTC
Permalink
Post by Lennert Buytenhek
Post by mbanditt
Try
export TERM='vt100'
before starting screen.
But this is a property of the terminal (i.e. the SSH client),
and not of the slug..
--L
Well, screen functions as a virtual terminal, and as screen runs on
the slug, it refers to that environment variable there.

Cheers,

Michael

Btw., in openslug and opendebianslug, I think, the variable is set
correctly. Only unslung might not have set it.




------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Lennert Buytenhek
2005-09-26 09:09:50 UTC
Permalink
Post by mbanditt
Post by Lennert Buytenhek
Post by mbanditt
Try
export TERM='vt100'
before starting screen.
But this is a property of the terminal (i.e. the SSH client),
and not of the slug..
Well, screen functions as a virtual terminal, and as screen runs on
the slug, it refers to that environment variable there.
But surely you should define TERM=vt100 _inside_ the screen session,
then, if screen emulates a VT100 terminal?
Post by mbanditt
Btw., in openslug and opendebianslug, I think, the variable is set
correctly. Only unslung might not have set it.
It might be a matter of the ssh daemon not setting it. (IIRC the
terminal type is passed over the ssh connection after logging in.)


--L


------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
mbanditt
2005-09-26 09:46:49 UTC
Permalink
Post by Lennert Buytenhek
But surely you should define TERM=vt100 _inside_ the screen session,
then, if screen emulates a VT100 terminal?
Post by mbanditt
Btw., in openslug and opendebianslug, I think, the variable is set
correctly. Only unslung might not have set it.
It might be a matter of the ssh daemon not setting it. (IIRC the
terminal type is passed over the ssh connection after logging in.)
--L
Hi Lennert,

I'm no expert here, but as I understood the functioning of screen, it
works kind of a server and a client. At least you have to 'attach' to
a running screen session (aka the "server") with screen (aka the
"client"). It's a bit like a windows manager (e.g. the X system with
client and server). I got the impression that this "client" site needs
the terminal type defined in order to connect to the screen "server".

On my desktop system (kanotix), the TERM variable is defined in
/etc/profile and there is a comment saying "# Basic terminal capab.
For screen etc.". Deleting the TERM variable on my desktop gives the
same error message from screen as seen on the slug (and this without
any remote connection via ssh).

That's just my understanding and I could be wrong, of course. But
screen definitely only works when TERM is defined on the machine on
which screen runs.

Cheers,

Michael





------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Lennert Buytenhek
2005-09-26 10:15:01 UTC
Permalink
Post by mbanditt
Hi Lennert,
Hello,
Post by mbanditt
I'm no expert here, but as I understood the functioning of screen, it
works kind of a server and a client. At least you have to 'attach' to
a running screen session (aka the "server") with screen (aka the
"client"). It's a bit like a windows manager (e.g. the X system with
client and server). I got the impression that this "client" site needs
the terminal type defined in order to connect to the screen "server".
That is correct.
Post by mbanditt
On my desktop system (kanotix), the TERM variable is defined in
/etc/profile and there is a comment saying "# Basic terminal capab.
For screen etc.". Deleting the TERM variable on my desktop gives the
same error message from screen as seen on the slug (and this without
any remote connection via ssh).
If deleting that bit from your /etc/profile causes the TERM variable
not to be set, that would appear to be a bug in your distro.

You cannot manually set the TERM variable under pretty much any
circumstance, as you have no idea what terminal you are possibly on.

When I login to my linux system on a virtual console, TERM is set to
'linux'. When I open an xterm in X, TERM is 'xterm'. That's the way
it should be, no script should need to meddle with these variables by
hand.


My other point was that if you login to the slug, it should pass the
TERM variable from the host you ssh from to your slug. (And if you
are using an integrated ssh client and terminal emulator like PuTTY,
it should pass any suitable terminal type that it can deal with.) If
it doesn't, that would appear to be a bug in the ssh daemon on the
slug or one of the login scripts on the slug.

sh-3.00$ export TERM=ajlshjsdhasd
sh-3.00$ ssh $otherhost echo $TERM
ajlshjsdhasd
sh-3.00$


That screen itself sets TERM to vt100 is fine, since screen is acting
as a vt100 terminal emulator, interpreting the escape codes from the
programs that run under it and converting those to a format suitable
for the actual terminal, if it's attached to one at that moment.


Hope this helps!


cheers,
Lennert


------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
bjallefix
2005-09-25 19:18:30 UTC
Permalink
Thanks alot!
It works now!!! :-)

Cheers,
Bjarte
Post by mbanditt
Try
export TERM='vt100'
before starting screen.
If it works, you need to define it within a diversion script.
Cheers,
Michael
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Malte Doersam
2005-09-26 13:59:35 UTC
Permalink
Post by Lennert Buytenhek
My other point was that if you login to the slug, it should pass the
TERM variable from the host you ssh from to your slug.  (And if you
are using an integrated ssh client and terminal emulator like PuTTY,
it should pass any suitable terminal type that it can deal with.)  If
it doesn't, that would appear to be a bug in the ssh daemon on the
slug or one of the login scripts on the slug.
sh-3.00$ export TERM=ajlshjsdhasd
sh-3.00$ ssh $otherhost echo $TERM
ajlshjsdhasd
sh-3.00$
Shell expansion played a trick on you :-)

$ export TERM=moo
$ ssh host echo $TERM
moo
$ ssh host 'echo $TERM'
dumb
Post by Lennert Buytenhek
cheers,
Lennert
cheers Malte




------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Lennert Buytenhek
2005-09-26 18:16:46 UTC
Permalink
Post by Malte Doersam
Post by Lennert Buytenhek
My other point was that if you login to the slug, it should pass the
TERM variable from the host you ssh from to your slug.  (And if you
are using an integrated ssh client and terminal emulator like PuTTY,
it should pass any suitable terminal type that it can deal with.)  If
it doesn't, that would appear to be a bug in the ssh daemon on the
slug or one of the login scripts on the slug.
sh-3.00$ export TERM=ajlshjsdhasd
sh-3.00$ ssh $otherhost echo $TERM
ajlshjsdhasd
sh-3.00$
Shell expansion played a trick on you :-)
Whoops. :-) Don't post before coffee.
Post by Malte Doersam
$ export TERM=moo
$ ssh host echo $TERM
moo
$ ssh host 'echo $TERM'
dumb
Same:

phi% export TERM=moo
zsh: can't find terminal definition for moo
phi% ssh xi 'echo $TERM'
***@xi's password:

phi%


But the case we were really interested in was this one:

phi% echo $TERM
moo
phi% ssh xi
***@xi's password:
Last login: Mon Sep 26 20:04:34 2005 from phi.wantstofly.org
xi% echo $TERM
moo
xi%


cheers,
Lennert


------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/O7EolB/TM
--------------------------------------------------------------------~->
Loading...