[vte/wip/rishi/precmd-preexec: 4/4] Test the shell-precmd signal



commit 6874841bca790e17ddb68ecadfae24f89c8bc62d
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed May 2 17:30:48 2018 +0200

    Test the shell-precmd signal
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711059
    https://bugzilla.gnome.org/show_bug.cgi?id=711060

 bindings/vala/app.vala |    6 ++++++
 src/app/app.cc         |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/bindings/vala/app.vala b/bindings/vala/app.vala
index 983fcbc..bb30ff5 100644
--- a/bindings/vala/app.vala
+++ b/bindings/vala/app.vala
@@ -309,6 +309,7 @@ class Window : Gtk.ApplicationWindow
     if (App.Options.object_notifications)
       terminal.notify.connect(notify_cb);
 
+    terminal.shell_precmd.connect(shell_precmd_cb);
     terminal.shell_preexec.connect(shell_preexec_cb);
 
     /* Settings */
@@ -782,6 +783,11 @@ class Window : Gtk.ApplicationWindow
     set_title(terminal.get_window_title());
   }
 
+  private void shell_precmd_cb(Vte.Terminal terminal)
+  {
+    print("[shell] showing command prompt\n");
+  }
+
   private void shell_preexec_cb(Vte.Terminal terminal)
   {
     print("[shell] executing command\n");
diff --git a/src/app/app.cc b/src/app/app.cc
index af9d801..f8b3e51 100644
--- a/src/app/app.cc
+++ b/src/app/app.cc
@@ -1589,6 +1589,12 @@ window_window_title_changed_cb(VteTerminal* terminal,
 }
 
 static void
+shell_precmd_cb(VteTerminal *terminal)
+{
+        g_print("[shell] showing command prompt\n");
+}
+
+static void
 shell_preexec_cb(VteTerminal *terminal)
 {
         g_print("[shell] executing command\n");
@@ -1821,6 +1827,7 @@ vteapp_window_constructed(GObject *object)
         if (options.object_notifications)
                 g_signal_connect(window->terminal, "notify", G_CALLBACK(window_notify_cb), window);
 
+        g_signal_connect(window->terminal, "shell-precmd", G_CALLBACK(shell_precmd_cb), NULL);
         g_signal_connect(window->terminal, "shell-preexec", G_CALLBACK(shell_preexec_cb), NULL);
 
         /* Settings */


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