kathmi / puttycyg

Automatically exported from code.google.com/p/puttycyg
0 stars 1 forks source link

When starting puttycyg maximized it gets the wrong terminal dimensions #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce:

from command line:
C:\>start /max putty -cygterm -

in the window that opens:
$ stty -a
speed 38400 baud; rows 24; columns 80; line = 0;

restore window and maximize again, and the situation is fixed:
$ stty -a
speed 38400 baud; rows 57; columns 158; line = 0;

This especially bothers me when I make a shortcut that opens puttycyg 
maximized, and I only realize the terminal size is wrong after I SSHed 
somewhere else. Then the restore-maximize doesn't help.

PutTTYcyg version: 20071202
Cygwin version: 1.5.25
Windows version: WinXP SP3

Original issue reported on code.google.com by itsa...@gmail.com on 10 Mar 2009 at 11:58

GoogleCodeExporter commented 9 years ago
Same problem when vim is running and pressing alt+enter brings full screen: the
columns and rows are incorrectly updated.
Then un-fullscreen and change the window size: you'll notice that either bash, 
stty
or tput report the previous window dimensions!
In this situation, terminal reset doesn't work any longer.

When vim is initially not running (like a fresh PuTTYcyg window), no noticeable 
problem.

Eric

Original comment by eric.sai...@gmail.com on 21 Jul 2009 at 3:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This turned out to be two separate issues.

When starting maximized, the cygterm_size message is called before cthelper has 
connected, so the cygterm 
backend throws away the resize.  This is fixed by resizing the terminal once 
cthelper connects.

When using full-screen mode, the cygterm_size message is called twice in rapid 
succession (under certain 
circumstances -- try setting the start menu to autohide and the problem goes 
away...)

This causes Windows to begin buffering the pipe between PuTTY and cthelper. I 
think.  At any rate, cthelper is 
then always one size change behind.  Setting an explicit buffer size in the 
CreatePipe call of one byte (instead 
of 0 which causes Windows to select a default buffer size) fixes the issue, at 
least for me.  It may not fix it on 
all versions of Windows (or future ones).  A better fix would be to use an IPC 
other than pipes for 
communicating resize events from PuTTY to cthelper.exe.

Original comment by medgar123 on 10 Aug 2009 at 11:43

GoogleCodeExporter commented 9 years ago
Try the 20090811 beta: 
http://puttycyg.googlecode.com/files/puttycyg-20090811.zip

Original comment by medgar123 on 11 Aug 2009 at 12:39

GoogleCodeExporter commented 9 years ago
Cheers

Original comment by benjamin...@gmail.com on 9 Mar 2010 at 4:27