+/**
+ * Called when the child process running in the VteTerminal exits.
+ */
+static void
+child_exited_cb (GtkWidget *widget, gpointer data)
+{
+ TildaTerminal *self = TILDA_TERMINAL(data);
+
+ /* These can stay here. They don't need to go into a header because
+ * they are only used at this point in the code. */
+ enum exit_actions { HOLD_TERMINAL_OPEN, RESTART_COMMAND, EXIT_TERMINAL };
+
+ /* Check the user's preference for what to do when the child terminal
+ * is closed. Take the appropriate action */
+ switch (self->exit_action)
+ {
+ case EXIT_TERMINAL:
+ tilda_window_remove_term (TILDA_WINDOW(self->parent_window), self->number);
+ break;
+ case RESTART_COMMAND:
+ vte_terminal_feed (VTE_TERMINAL(self->vte_term), "\r\n\r\n", 4);
+ tilda_terminal_start_shell (self);
+ break;
+ case HOLD_TERMINAL_OPEN:
+ break;
+ default:
+ break;
+ }
+}
+