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 19:42 Harold
  2004-02-04 19:58 ` Igor Pechtchanski
@ 2004-02-04 22:05 ` Brian Ford
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Ford @ 2004-02-04 22:05 UTC (permalink / raw)
  To: Harold; +Cc: cygwin

On Wed, 4 Feb 2004 Harold at Levy dot synopsys dot com wrote:

> 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.
>
This means nothing.  Depending on what mirror you used and a host of other
variables, anything is possible.  That is why we specifically ask for
cygcheck output to be attached here:

> Problem reports:       http://cygwin.com/problems.html
>

> I don't have this problem when I use a terminal emulator like SecureCRT.
>
> Thank you very much for any help,
>
WAG: You don't have this change:

2004-01-21  Christopher Faylor  <cgf@redhat.com>

        * fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change
        for TIOCSWINSZ.  It is not an error for ioctl_request_event to be
        missing.

Which was prompted by this, IIRC:

http://cygwin.com/ml/cygwin/2004-01/msg00789.html

But, I can not determine if that is in 1.5.7.  Could you try the
latest snapshot?  Thanks.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

--
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

* Re: terminal size problems
  2004-02-04 19:42 Harold
@ 2004-02-04 19:58 ` Igor Pechtchanski
  2004-02-04 22:05 ` Brian Ford
  1 sibling, 0 replies; 5+ messages in thread
From: Igor Pechtchanski @ 2004-02-04 19:58 UTC (permalink / raw)
  To: Harold; +Cc: cygwin

On Wed, 4 Feb 2004 Harold<at>Levy<dot>synopsys<dot>com wrote:

> Hi, when my cygwin terminals are sized to something other than 24 rows

I'm assuming you're talking about the command windows running bash.

> 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,

Huh?

> whether I set TERMINFO on the remote machine, whether I do
> terminal reset/resize, or whether the remote machine is Linux/SunOS.

Depending on the version of Windows you have, the command windows behave
differently.  Win9x command windows are completely retarded, and nothing
can be done to save them.  Win2k's cmd ones are slightly better, and if
your remote machine has the correct definition of the "cygwin"
termcap/terminfo entry, they should work.  FWIW, I'm not seeing any
problems running vi on a RedHat 9.0 machine via ssh from a Win2k cmd
window sized 120x40.

> 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

In any case, you can use rxvt in Win32 mode under Cygwin as a workaround.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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).