public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Harold Levy <Harold.Levy@synopsys.com>
To: cygwin@cygwin.com
Subject: Re: terminal size problems
Date: Fri, 27 Feb 2004 07:20:00 -0000	[thread overview]
Message-ID: <20040227031443.GA15576@shark.synopsys.com> (raw)

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/

             reply	other threads:[~2004-02-27  3:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27  7:20 Harold Levy [this message]
  -- 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040227031443.GA15576@shark.synopsys.com \
    --to=harold.levy@synopsys.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).