🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.rt
Article #544

How Does rlogin Know Terminal Rows and Columns?

#544
From: D. Jason Penney
Date: Tue, 07 Nov 1989 06:54
37 lines
2466 bytes
My circumstances are a little complicated, but the problem is simple
enough once I've explained it.  I have a program driving a pseudo-tty
which is running a shell.  Within this pseudo-tty, I want all programs
(such as vi) to know how many rows and columns they are dealing with.

Just to complicate matters, suppose the original "physical" tty is
something weird, like a window under sunview.  Even worse, the
window can be resized.

In point of fact, if I "rlogin" to our AIX system using a SunView window,
the resulting AIX session gets everything right.  I can test it by
climbing into vi and either typing away madly in insert mode, or examining
the terminal height using ":se window".  I can climb out of vi, resize
my window (on the Sun, now), climb back into vi and see that AIX has
properly registered the new window size.

In a BSD system like SunOS, I use the TIOGCWINSZ and TIOCSWINSZ ioctl's
to read the window's current size and to propogate it to the pseudo-tty.
I even have a SIGWINCH to let me know when to do the ioctl's.

I've RTFM'd the AIX Tech Ref until I'm blue in the face, and the solution
still escapes me.  I find it interesting that the BSD rlogin program 
is handshaking properly to the AIX rlogind.

I would appreciate some one with the appropriate expertise (System V
or AIX) or access to the source code to let me know exactly what I should
be doing to 1) read my terminal characteristics (rows and columns) and, 
just as important, 2) propogate them to my pseudo-tty.  As a bonus,
it would be pleasant to know how to detect when the window size has
changed (SIGWINCH).

Please e-mail to me at the address below.  Thanks in advance.
-- 
D. Jason Penney                  Ph: (503) 629-8383
Beaverton, OR 97006              uucp: ...uunet!servio!penneyj
STANDARD DISCLAIMER:  Should I or my opinions be caught or killed, the
company will disavow any knowledge of my actions...
Technical Details
Message-ID: <275@servio.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!percy!parsely!bucket!servio!penneyj

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!zephyr.ens.tek.com!tektronix!percy!parsely!bucket!servio!penneyj
From: penneyj@servio.UUCP (D. Jason Penney)
Newsgroups: comp.sys.ibm.pc.rt,comp.unix.wizards
Subject: How Does rlogin Know Terminal Rows and Columns?
Summary: Uncle!
Keywords: AIX, System-V, termio
Message-ID: <275@servio.UUCP>
Date: 7 Nov 89 06:54:27 GMT
Reply-To: penneyj@servio.UUCP (D. Jason Penney)
Organization: Servio Logic Development Corp.; Beaverton, OR
Lines: 37