From: Ira W. Snyder Date: Sun, 20 Jan 2008 03:29:16 +0000 (-0800) Subject: [Terminal] Add RunCommand method to the DBus API X-Git-Url: https://www.irasnyder.com/gitweb/?a=commitdiff_plain;h=7f09fc152737d466464b94a921ee28df6fc7f6ea;p=tilda-gobject.git [Terminal] Add RunCommand method to the DBus API The RunCommand method allows users to send arbitrary text over DBus, and have it entered into the terminal as if they had typed it themselves. This is a feature which was requested by Chris Ward. Thanks! --- diff --git a/tilda-terminal.c b/tilda-terminal.c index 91921d2..12c08af 100644 --- a/tilda-terminal.c +++ b/tilda-terminal.c @@ -22,6 +22,18 @@ tilda_terminal_dbus_register_object (TildaTerminal *tt) g_free (object_path); } +gboolean +tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error) +{ + debug_enter (); + debug_assert (TILDA_IS_TERMINAL(self)); + + vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), command, -1); + vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), "\n", -1); + + return TRUE; +} + /** * Start the current tt->shell in the given TildaTerminal * NOTE: this will kill whatever is running in the terminal, diff --git a/tilda-terminal.h b/tilda-terminal.h index 9abff00..81815f0 100644 --- a/tilda-terminal.h +++ b/tilda-terminal.h @@ -80,6 +80,7 @@ struct _TildaTerminalClass { GType tilda_terminal_get_type (void); /* API */ +gboolean tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error); #endif /* TILDA_TERMINAL_H */ diff --git a/tilda-terminal.xml b/tilda-terminal.xml index f17c40f..0818981 100644 --- a/tilda-terminal.xml +++ b/tilda-terminal.xml @@ -5,6 +5,11 @@ + + + + +