public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: terminal size problems
@ 2004-02-27  7:20 Harold Levy
  0 siblings, 0 replies; 5+ messages in thread
From: Harold Levy @ 2004-02-27  7:20 UTC (permalink / raw)
  To: cygwin

Hi, a few weeks ago I reported a problem with rlogin not transmitting
the correct window size when run from cygwin.  The fact that there was
no problem with telnet gnawed at me, so I investigated the code
differences and found that rlogin.c from the gnu inetutils distribution
(e.g. 1.4.2) has flawed support for TIOCGWINSZ and SIGWINCH.  I also
discovered that clients such as vim, mutt, etc. differ widely in their
sophistication in supporting TIOCGWINSZ and SIGWINCH ... e.g. mutt
must be compiled with ncurses, vim does not.

Anyway, here is my context diff for getting rlogin.c in the
inetutils-1.4.2 distribution to support TIOCGWINSZ and SIGWINCH
under cygwin; the changes are #if'ed out so to activate them compile
with -DWINSZ_HACK.  Also, since I couldn't figure out how to get a
root account working under cygwin, I #if'ed out the geteuid() call;
compile with -DNO_GETEUID to use.

Regards,

-Harold


*** rlogin.c	Thu Feb 26 18:55:58 2004
--- rlogin.c.new	Thu Feb 26 19:03:22 2004
***************
*** 325,332 ****
--- 325,334 ----
      usage (1);
  
    /* We must be uid root to access rcmd().  */
+ #ifndef NO_GETEUID
    if (geteuid ())
      errx (1, "must be setuid root.\n");
+ #endif
  
    /* Get the name of the user invoking us: the client-user-name.  */
    if (!(pw = getpwuid (uid = getuid ())))
***************
*** 406,411 ****
--- 408,417 ----
    setsig (SIGURG, copytochild);
    setsig (SIGUSR1, writeroob);
  
+ #ifdef WINSZ_HACK
+   setsig (SIGWINCH, sigwinch);
+ #endif
+ 
  #ifdef KERBEROS
   try_connect:
    if (use_kerberos)
***************
*** 683,689 ****
--- 689,699 ----
    exit (status);
  }
  
+ #ifdef WINSZ_HACK
+ int dosigwinch=1;
+ #else
  int dosigwinch;
+ #endif
  
  /*
   * This is called when the reader process gets the out-of-band (urgent)
***************
*** 732,737 ****
--- 742,751 ----
    register int bol, local, n;
    char c;
  
+ #ifdef WINSZ_HACK
+   sendwindow();
+ #endif
+ 
    bol = 1;			/* beginning of line */
    local = 0;
    for (;;)
***************
*** 944,949 ****
--- 958,966 ----
      {
        /* Let server know about window size changes */
        kill (ppid, SIGUSR1);
+ #ifdef WINSZ_HACK
+       sigwinch(0);
+ #endif
      }
    if (!eight && (mark & TIOCPKT_NOSTOP))
      {

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: terminal size problems
@ 2004-02-04 21:11 Shaffer, Kenneth
  0 siblings, 0 replies; 5+ messages in thread
From: Shaffer, Kenneth @ 2004-02-04 21:11 UTC (permalink / raw)
  To: cygwin


rlogin, to my knowledge, has nothing to do with the X protocol of
resizing.

After you resize your window, set some variables accordingly:

LINES=height
COLUMNS=width

export LINES COLUMNS

If you start with an xterm, you shouldn't have a problem, but since you
started with a console window and just rlog'd in to a machine, you'll have
to set these variables.

Best to have a cygwin terminfo entry too.

--
Ken Shaffer



     - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* terminal size problems
@ 2004-02-04 19:42 Harold
  2004-02-04 19:58 ` Igor Pechtchanski
  2004-02-04 22:05 ` Brian Ford
  0 siblings, 2 replies; 5+ messages in thread
From: Harold @ 2004-02-04 19:42 UTC (permalink / raw)
  To: cygwin

Hi, when my cygwin terminals are sized to something other than 24 rows
they don't work correctly with apps like vim/mutt/less when I connect to
a remote unix system; these apps behave like they think the terminal
has 24 rows.  It doesn't matter whether I use the bash shell or an
xterm, whether I set TERMINFO on the remote machine, whether I do
terminal reset/resize, or whether the remote machine is Linux/SunOS.
I'm using the latest cygwin updates as of today.  I don't have this
problem when I use a terminal emulator like SecureCRT.

Thank you very much for any help,

-Harold


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-27  3:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-27  7:20 terminal size problems Harold Levy
  -- strict thread matches above, loose matches on Subject: below --
2004-02-04 21:11 Shaffer, Kenneth
2004-02-04 19:42 Harold
2004-02-04 19:58 ` Igor Pechtchanski
2004-02-04 22:05 ` Brian Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).