Re: vte_terminal_fork_command behavior



I'm not sure, i've tested only running in some gnome version from
Archlinux repositories.

I'll try to perform more tests before submit any kind of bug report.

Maybe somebody could try this little program:

#include<gtk/gtk.h>
#include<vte/vte.h>
#include<stdio.h>

void
fork_done(VteTerminal *vte, gpointer udata)
{
       printf("Process died!!\n");
}

gboolean
window_deleted( GtkWidget *w, GdkEvent *ev, gpointer data)
{
       GtkWidget *vte = (GtkWidget*)data;
       char *text = "\n";

       printf("Finish command\n");
       vte_terminal_feed_child(VTE_TERMINAL(vte), text, strlen(text));

       gtk_widget_hide_all(w);

       return TRUE;
}

int main(int argc, char* argv[])
{
       char *params[] = {"/bin/sh", "-c", "ls -l ~/",NULL};
       int child;

       gtk_init(&argc, &argv);

       GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       GtkWidget *table = gtk_table_new (1, 1, TRUE);
       GtkWidget *vte1 = vte_terminal_new ();

       gtk_signal_connect(GTK_OBJECT(vte1), "child-exited",
G_CALLBACK(fork_done), NULL);
       gtk_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(window_deleted), vte1);
       gtk_table_attach_defaults (table, GTK_WIDGET(vte1), 0, 1, 0, 1);
       gtk_container_add (window, table);
       gtk_widget_show_all (window);

       child = vte_terminal_fork_command (VTE_TERMINAL(vte1), "sh", params,
NULL, "~/", FALSE, FALSE, FALSE);
       printf("Child: %d\n", child);

       gtk_main ();

       return 0;
}

i've compiled this way: gcc vte.c `pkg-config --cflags --libs
gtk+-2.0` `pkg-config --cflags --libs vte` (or something like this).

Anyway, I'll run my own tests but I can survive with this "feature" hehehe

Cheers



On Tue, Jan 27, 2009 at 4:57 AM, Behdad Esfahbod <behdad behdad org> wrote:
> Ignacio Butler wrote:
>> Hi!
>>
>> I'm starting a little project and i need to include the vte widget in
>> my application. I haven't experience with this widget and i wrote a
>> little program only for testing and training and i'm seeing an strange
>> behavior depending on the command i run.
>>
>> If I do
>>    vte_terminal_fork_command(w, "vim", NULL, NULL, ".", FALSE, FALSE, FALSE);
>>
>> Vim is executed and i can interact with it. But if I run a program
>> like "ls", which ends after directory listing, no output is shown, no
>> matter what I do.
>>
>> How I can show output of programs that ends? Is this behavior normal?
>
> Sounds like a bug.  May have already been fixed.  Please file a report at
> http://bugzilla.gnome.org/
>
> behdad
>
>> Thank you all in advance
>> ignacio
>> _______________________________________________
>> gnome-devel-list mailing list
>> gnome-devel-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
>>
>



-- 
who | grep -i blonde | talk;
cd ~; wine; talk; touch;
unzip; touch; strip; gasp;
finger; gasp; mount; fsck;
more; yes; gasp; umount;
make clean; sleep;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]