X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=sympathy.git;a=blobdiff_plain;f=src%2Fptty.c;h=f8b6b9fced7c8467d1643399a257c789ff779022;hp=0c69a2b31a3077b7516b1d3b302749aa3efcf603;hb=3e72a1f6fc28777c26e4fb109867bd2a3c7b89b0;hpb=1774913685868a7ab501156a30f355a7372362ea diff --git a/src/ptty.c b/src/ptty.c index 0c69a2b..f8b6b9f 100644 --- a/src/ptty.c +++ b/src/ptty.c @@ -10,6 +10,36 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.16 2008/02/28 16:57:52 james + * *** empty log message *** + * + * Revision 1.15 2008/02/27 09:42:53 james + * *** empty log message *** + * + * Revision 1.14 2008/02/27 09:42:22 james + * *** empty log message *** + * + * Revision 1.13 2008/02/27 01:31:38 james + * *** empty log message *** + * + * Revision 1.12 2008/02/27 01:31:14 james + * *** empty log message *** + * + * Revision 1.11 2008/02/26 23:23:17 james + * *** empty log message *** + * + * Revision 1.10 2008/02/24 00:42:53 james + * *** empty log message *** + * + * Revision 1.9 2008/02/23 13:05:58 staffcvs + * *** empty log message *** + * + * Revision 1.8 2008/02/23 11:48:37 james + * *** empty log message *** + * + * Revision 1.7 2008/02/22 17:07:00 james + * *** empty log message *** + * * Revision 1.6 2008/02/22 14:51:54 james * *** empty log message *** * @@ -122,31 +152,29 @@ ptty_write (TTY * _t, void *buf, int len) } TTY * -ptty_open (char *path, char *argv[]) +ptty_open (char *path, char *argv[], CRT_Pos * size) { PTTY *t; pid_t child; char name[1024]; struct winsize winsize = { 0 }; - struct termios termios; + struct termios ctermios = { 0 }; int fd; char *default_argv[] = { "-", (char *) 0 }; - default_termios (&termios); - - winsize.ws_row = VT102_ROWS; - winsize.ws_col = VT102_COLS; + client_termios (&ctermios); + winsize.ws_row = size ? size->y : VT102_ROWS_24; + winsize.ws_col = size ? size->x : VT102_COLS_80; - child = forkpty (&fd, name, &termios, &winsize); + child = forkpty (&fd, name, &ctermios, &winsize); switch (child) { case -1: /*boo hiss */ return NULL; case 0: /*waaah */ - setenv ("TERM", "ansi", 1); - setenv ("LANG", "C", 1); + setenv ("TERM", "xterm", 1); if (!path) path = "/bin/sh"; @@ -159,6 +187,16 @@ ptty_open (char *path, char *argv[]) set_nonblocking (fd); +#if 0 + { + struct termios termios = { 0 }; + + tcgetattr (fd, &termios); + default_termios (&termios); + tcsetattr (fd, TCSANOW, &termios); + } +#endif + t = (PTTY *) malloc (sizeof (PTTY)); strncpy (t->name, name, sizeof (t->name));