X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fptty.c;h=b2e5d0f15783cd1bbd23508bfbcc9cf9f7b62bb8;hb=8a3aac5f5287422699c9c7c5ee8969561da7317f;hp=e2688259a51b591ff692073d15232b97ef96abea;hpb=4145f7369d761b32a10309a2623d98e64de7f444;p=sympathy.git diff --git a/src/ptty.c b/src/ptty.c index e268825..b2e5d0f 100644 --- a/src/ptty.c +++ b/src/ptty.c @@ -10,6 +10,18 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * 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 *** * @@ -131,25 +143,22 @@ ptty_write (TTY * _t, void *buf, int len) } TTY * -ptty_open (char *path, char *argv[]) +ptty_open (char *path, char *argv[], int width) { PTTY *t; pid_t child; char name[1024]; struct winsize winsize = { 0 }; - struct termios termios = { 0 }; + struct termios ctermios = { 0 }; int fd; char *default_argv[] = { "-", (char *) 0 }; - default_termios (&termios); - cfsetispeed (&termios, B9600); - cfsetospeed (&termios, B9600); - + client_termios (&ctermios); winsize.ws_row = VT102_ROWS; - winsize.ws_col = VT102_COLS; + winsize.ws_col = width ? width : VT102_COLS_80; - child = forkpty (&fd, name, &termios, &winsize); + child = forkpty (&fd, name, &ctermios, &winsize); switch (child) { @@ -169,6 +178,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));