--- vte-0.11.10/src/vte.h.orig 2003-06-16 14:15:10.000000000 -0700 +++ vte-0.11.10/src/vte.h 2004-02-20 19:16:57.000000000 -0800 @@ -158,6 +158,10 @@ gboolean utmp, gboolean wtmp); +/* Attach an existing PTY master side to the terminal widget. Use + * instead of vte_terminal_fork_command. */ +void vte_terminal_add_pty(VteTerminal *terminal, int pty_master); + /* Send data to the terminal to display, or to the terminal's forked command * to handle in some way. If it's 'cat', they should be the same. */ void vte_terminal_feed(VteTerminal *terminal, const char *data, glong length); --- vte-0.11.10/src/vte.c.orig 2004-02-20 18:44:24.000000000 -0800 +++ vte-0.11.10/src/vte.c 2004-02-20 19:17:00.000000000 -0800 @@ -6897,6 +6897,36 @@ return pid; } +/** + * vte_terminal_add_pty: + * @terminal: a #VteTerminal + * @pty_master: a file descriptor of the master end of a PTY + * + * Attach an existing PTY master side to the terminal widget. Use + * instead of vte_terminal_fork_command. + */ +void +vte_terminal_add_pty(VteTerminal *terminal, int pty_master) +{ + GtkWidget *widget; + + g_return_val_if_fail(VTE_IS_TERMINAL(terminal), -1); + widget = GTK_WIDGET(terminal); + + if (terminal->pvt->pty_master != -1) { + _vte_pty_close(terminal->pvt->pty_master); + close(terminal->pvt->pty_master); + } + terminal->pvt->pty_master = pty_master; + + /* Open channels to listen for input on. */ + _vte_terminal_connect_pty_read(terminal); + + /* Open channels to write output to. */ + _vte_terminal_connect_pty_write(terminal); +} + + /* Handle an EOF from the client. */ static void vte_terminal_eof(GIOChannel *channel, gpointer data)