delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/26/22:14:58

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 26 Feb 2004 19:14:43 -0800
From: Harold Levy <Harold DOT Levy AT synopsys DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: terminal size problems
Message-ID: <20040227031443.GA15576@shark.synopsys.com>
Mime-Version: 1.0
User-Agent: Mutt/1.4.2.1i

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019