Configure the pty so that it agrees with our idea of whether
[sgt/putty] / unix / pty.c
index a3d2fc7..2a7abb6 100644 (file)
@@ -236,6 +236,17 @@ static char *pty_init(char *host, int port, char **realhost, int nodelay)
 #endif
 
     /*
+     * Set the backspace character to be whichever of ^H and ^? is
+     * specified by bksp_is_delete.
+     */
+    {
+       struct termios attrs;
+       tcgetattr(pty_master_fd, &attrs);
+       attrs.c_cc[VERASE] = cfg.bksp_is_delete ? '\177' : '\010';
+       tcsetattr(pty_master_fd, TCSANOW, &attrs);
+    }
+
+    /*
      * Trap as many fatal signals as we can in the hope of having
      * the best chance to clean up utmp before termination.
      */
@@ -402,6 +413,8 @@ static void pty_size(void)
 
     size.ws_row = (unsigned short)rows;
     size.ws_col = (unsigned short)cols;
+    size.ws_xpixel = (unsigned short) cols * font_dimension(0);
+    size.ws_ypixel = (unsigned short) rows * font_dimension(1);
     ioctl(pty_master_fd, TIOCSWINSZ, (void *)&size);
     return;
 }