: How does 'rlogin' copy terminal size to remote system ?

: How does 'rlogin' copy terminal size to remote system ?

Post by Information Tech divisi » Sat, 14 Jan 1995 00:47:53



When 'rlogin' to a remote system, rlogin will copy the terminal size
to the remote system. How does it do that ?

----------------------------------------

 
 
 

: How does 'rlogin' copy terminal size to remote system ?

Post by Scott Marovi » Sun, 15 Jan 1995 09:59:12


Quote:>When 'rlogin' to a remote system, rlogin will copy the terminal size to the
>remote system. How does it do that?

The protocol that "rlogin" uses actually ships over a copy of your "$TERM"
environment variable, and yes, this can fail if your local and remote systems
don't both have compatible definitions of your terminal type in their
"termcap" or "terminfo" databases.  The last time that I looked at the code,
years ago, it sppeared that the length of the "$TERM" value could be up to 63
characters, so it's potentially possible to play some really sleazy tricks by
encoding various other kinds of data into your local "$TERM" variable just
before executing "rlogin", then using a ".profile/.login" file at the remote
site to unpack it.  I leave it as an exercise for the interested reader . . ..
--
Scott Marovich                   Hewlett-Packard Laboratories M/S 1U15

HP-DESK: Scott_Marovich/1900/UX  Palo Alto CA 94303-0971 U.S.A.
HP TELNET 857-2998               (415)857-2998

 
 
 

: How does 'rlogin' copy terminal size to remote system ?

Post by Barry Margol » Tue, 17 Jan 1995 16:16:05



Quote:>When 'rlogin' to a remote system, rlogin will copy the terminal size
>to the remote system. How does it do that ?

Rlogin includes the terminal type, screen size, and line speed in the
initial data that it sends to the server.

Also, if the terminal size changes (i.e. you're on a window system and you
resive the window) there's a protocol for rlogin to notify the server.

I think the details of the protocol are described in W. Richard Stevens's
"Unix Network Programming".
--

Barry Margolin
BBN Internet Services Corp.

 
 
 

: How does 'rlogin' copy terminal size to remote system ?

Post by Malcolm Mladenov » Tue, 17 Jan 1995 20:46:57



>Rlogin includes the terminal type, screen size, and line speed in the
>initial data that it sends to the server.

>Also, if the terminal size changes (i.e. you're on a window system and you
>resive the window) there's a protocol for rlogin to notify the server.

>I think the details of the protocol are described in W. Richard Stevens's
>"Unix Network Programming".

Or try RFC 1282:

# Network Working Group                                          B. Kantor
# Request for Comments: 1282                      Univ. of Calif San Diego
# Obsoletes: RFC 1258                                        December 1991
#
#
#                                BSD Rlogin
#
# Status of this Memo
#
#    This memo documents an existing protocol and common implementation
#    that is extensively used on the Internet.

Window size is not sent as part of the initial data.  It is sent only
after the server indicates that it can accept it (presumably because
older servers would not understand the data if sent unsolicited).

-Malcolm

[standard discalimer applies - I do not speak for my employer]

 
 
 

: How does 'rlogin' copy terminal size to remote system ?

Post by Darin Johns » Thu, 19 Jan 1995 02:48:25


Just a note.  After years of using UNIX, 10 or so where window systems
were important, I finally learned that rlogin set the COLUMNS and
LINES, but that it doesn't export them!  I was busy trying to sneak
'resize' onto the systems I use when I realized all I had to do was
export the vars in my .profile...

Of course, I still have to set the row size when I telnet offsite
from an xterm.

Rlogin is a hack though, as mentioned in the Goodby To BSD issue
of UNIX Review.  (it was whipped up to provide temporary functionality
while telnet was being worked on :-)
--
Darin Johnson

    Where am I?  In the village...  What do you want?  Information...

 
 
 

1. Problem in getting screen size when 'rlogin' and 'telnet'

Hi,
        I have a problem in getting screen size using "ioctl" function.

        The following program returns the correct screen size if the term is
by "rlogin" but does return an error if term is by "telnet".

#include<stdio.h>
#include<termios.h>
#include<unistd.h>
extern int errno;
main()
{
   struct winsize ws;

   if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) < 0)
        printf("%d is the errno\n", errno);

   printf("%d is the width\n", ws.ws_col);
   printf("%d is the length\n", ws.ws_row);

The output for the above program from an "rlogin" window is
90 is the width
58 is the length

The output from a "telnet" window is
22 is the errno
0 is the width
0 is the length

Could anybody educate me regarding this?

        Also "stty" behaves differently from "rlogin" window and from a "telnet"
window.
        The command "stty rows 24" works Okay on an "rlogin" terminal
but, on a "telnet" terminal it gives the following error:
        unknown mode: rows

Could anybody help me in this regard? Please send me email.

Thanks

vasant

2. SU problems.. - cannot set groups

3. Is e2label 'dangerous' when done on a 'live' file system?

4. not so good vga screen in dosemu?

5. Doing 'r' commands says "requires secure terminal"

6. ad-blocking thru Apache 1.3

7. Doing 'stty erase ^H' on remote shells

8. Help on compile Modules after kernel config

9. My linux refuses 'rlogin' 'telnet' what is the problem??

10. Remote X terminal... won't use the terminals hardware

11. 'w' shows '-' if telnet or rlogin to linux box

12. Will changing IP address affect 'rlogin'/'telnet'?

13. 'su' and 'rlogin' wierdness under 2.6 ...