X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fptty.c;h=b8e77b189cc2e87b86b7c20fc624b07d0fd3f81d;hb=95d068f1b4e8100d6501944eda3bd9ff73460514;hp=1e3ce3693d6bf4a081f5313c336a2b7f516adeb4;hpb=ded21942fccb9fde8c3264c8f9a3dcdbc6ae1c38;p=sympathy.git diff --git a/src/ptty.c b/src/ptty.c index 1e3ce36..b8e77b1 100644 --- a/src/ptty.c +++ b/src/ptty.c @@ -10,6 +10,27 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * 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 *** + * * Revision 1.5 2008/02/15 23:52:12 james * *** empty log message *** * @@ -119,31 +140,29 @@ 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; + struct termios ctermios = { 0 }; int fd; char *default_argv[] = { "-", (char *) 0 }; - default_termios (&termios); - + 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) { case -1: /*boo hiss */ return NULL; case 0: /*waaah */ - setenv ("TERM", "vt102", 1); - setenv ("LANG", "C", 1); + setenv ("TERM", "xterm", 1); if (!path) path = "/bin/sh"; @@ -156,6 +175,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));