diff -c3 -r screen-3.7.1/config.h.in screen-3.7.1.local/config.h.in
*** screen-3.7.1/config.h.in	Mon Nov 20 10:08:42 1995
--- screen-3.7.1.local/config.h.in	Fri Dec 13 00:49:45 1996
***************
*** 454,456 ****
--- 454,461 ----
  #undef PTYRANGE0
  #undef PTYRANGE1
  
+ /*
+  * support for ssh-agent from the ssh package; which prevents screen from
+  * closing the SSH_AUTHENTICATION_FD if it is open.
+  */
+ #define SSH_SUPPORT 1
Only in screen-3.7.1.local: kmapdef.c
diff -c3 -r screen-3.7.1/misc.c screen-3.7.1.local/misc.c
*** screen-3.7.1/misc.c	Mon Nov 20 10:03:04 1995
--- screen-3.7.1.local/misc.c	Fri Dec 13 00:43:14 1996
***************
*** 40,45 ****
--- 40,48 ----
  extern int eff_gid, real_gid;
  extern struct mline mline_old;
  extern char *null, *blank;
+ #if SSH_SUPPORT
+ extern int ssh_authentication_fd;
+ #endif
  
  char *
  SaveStr(str)
***************
*** 289,295 ****
    f = getdtablesize();
  #endif /* SYSV && !ISC */
    while (--f > 2)
!     if (f != except)
        close(f);
  }
  
--- 292,302 ----
    f = getdtablesize();
  #endif /* SYSV && !ISC */
    while (--f > 2)
!     if (f != except
! #if SSH_SUPPORT
!       && ssh_authentication_fd && f != ssh_authentication_fd
! #endif
!       )
        close(f);
  }
  
diff -c3 -r screen-3.7.1/screen.c screen-3.7.1.local/screen.c
*** screen-3.7.1/screen.c	Mon Nov 20 10:03:05 1995
--- screen-3.7.1.local/screen.c	Fri Dec 13 00:43:14 1996
***************
*** 191,196 ****
--- 191,199 ----
  struct win *windows;
  struct win *console_window;
  
+ #if SSH_SUPPORT
+ int ssh_authentication_fd;
+ #endif
  
  
  /*
***************
*** 311,316 ****
--- 314,329 ----
  #endif /* PSEUDOS */
      }
    FD_SET(ServerSocket, rp);
+ #if SSH_SUPPORT
+   if( ssh_authentication_fd ) {
+     if( FD_ISSET(ssh_authentication_fd, rp) ) {
+       debug("SSH_AUTHENTICATION_FD is set in rp\n");
+     }
+     if( FD_ISSET(ssh_authentication_fd, wp) ) {
+       debug("SSH_AUTHENTICATION_FD is set in wp\n");
+     }
+   }
+ #endif
  }
  
  void
***************
*** 357,362 ****
--- 370,388 ----
      sigprocmask(SIG_SETMASK, &sset, 0);
    }
  #endif
+ 
+ #if SSH_SUPPORT
+   {
+     char *env;
+ 
+     env = getenv( "SSH_AUTHENTICATION_FD" );
+     if( env ) {
+       ssh_authentication_fd = atoi( env );
+     }
+     /* assume that ssh_authentication_fd is never = 0 */
+   }
+ #endif
+   
  
    /*
     *  First, close all unused descriptors
diff -c3 -r screen-3.7.1/window.h screen-3.7.1.local/window.h
*** screen-3.7.1/window.h	Mon Nov 20 10:03:05 1995
--- screen-3.7.1.local/window.h	Fri Dec 13 00:43:14 1996
***************
*** 23,29 ****
   */
  
  #ifndef MAXWIN
! # define MAXWIN	10
  #endif
  
  
--- 23,29 ----
   */
  
  #ifndef MAXWIN
! # define MAXWIN	99
  #endif
  
  
