[Terminal] Add RunCommand method to the DBus API
[tilda-gobject.git] / tilda-terminal.c
index 91921d2..12c08af 100644 (file)
@@ -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,