Hi,

I have made a small patch against POE 0.27 which let you set the window size
for a pty for a process started with POE::Wheel::Run. Addtionaly to Conduit
=> 'pty' you have to specify the parameter Winsize => [24,80] to get a
window size with 24 lines and 80 columns, independly of the size of the
current terminal.

I have tested it successfully on Linux.

Would be nice to see this in the next POE release

Gerald

--- Run.pm      (revision 96)
+++ Run.pm      (working copy)
@@ -152,6 +152,10 @@
     $conduit = "pipe";
   }

+  my $winsize = delete $params{Winsize};
+  croak "Winsize needs to be an array ref"
+    if (defined ($winsize) && ref ($winsize) ne 'ARRAY') ;
+
   my $stdin_event  = delete $params{StdinEvent};
   my $stdout_event = delete $params{StdoutEvent};
   my $stderr_event = delete $params{StderrEvent};
@@ -308,6 +312,7 @@
         if (-t STDIN) {
           my $window_size = '!' x 25;
           ioctl( STDIN, TIOCGWINSZ, $window_size ) or die $!;
+         $window_size = pack ('SSSS', @$winsize) if (ref $winsize) ;
           ioctl( $stdin_read, TIOCSWINSZ, $window_size ) or die $!;
         }
         else {
@@ -1096,6 +1101,16 @@

 Pty conduits require the IO::Pty module.

+=item Winsize
+
+C<Winsize> is only valid for C<Conduit = pty> and used to set the window
+size of the pty device. The window size
+is given as an array reference.
+The first element is the number of lines, the
+second the number of columns. The third and the fourth optional argument
+can give the x and y width in pixels.
+
+
 =item CloseOnCall

 C<CloseOnCall> emulates the close-on-exec feature for child processes

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securityl�sungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     [EMAIL PROTECTED]          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------

Reply via email to