billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=ad7409fdfc38353118c2188e4a20a621969f4350

commit ad7409fdfc38353118c2188e4a20a621969f4350
Author: Toan Pham <tpham3...@gmail.com>
Date:   Sun Mar 6 13:37:49 2016 +0100

    Add shortcut to change tab's title
    
    Signed off:  Toan Pham <tpham3...@gmail.com>
---
 man/terminology.1 |  4 ++++
 src/bin/config.c  |  1 +
 src/bin/keyin.c   | 11 +++++++++++
 3 files changed, 16 insertions(+)

diff --git a/man/terminology.1 b/man/terminology.1
index 75c4083..918a86b 100644
--- a/man/terminology.1
+++ b/man/terminology.1
@@ -232,6 +232,10 @@ Switch focus to next terminal inside a window (when using 
splits).
 Toggle displaying the miniview of the history.
 .
 .TP
+.B Ctrl+t
+Set tab's title.
+.
+.TP
 .B Ctrl+Shift+t
 Create a new terminal on top of current inside window (tabs).
 .
diff --git a/src/bin/config.c b/src/bin/config.c
index 54ed8ac..c141a9b 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -324,6 +324,7 @@ _add_default_keys(Config *config)
    ADD_KB("7", 1, 0, 0, 0, "tab_7");
    ADD_KB("8", 1, 0, 0, 0, "tab_8");
    ADD_KB("9", 1, 0, 0, 0, "tab_9");
+   ADD_KB("t", 1, 0, 0, 0, "tab_title");
 
    /* Alt- */
    ADD_KB("Home", 0, 1, 0, 0, "cmd_box");
diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index 14731b2..661080e 100644
--- a/src/bin/keyin.c
+++ b/src/bin/keyin.c
@@ -387,6 +387,16 @@ cb_term_new(Evas_Object *termio_obj)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+cb_tab_set_title(Evas_Object *termio_obj)
+{
+   Term *term = termio_term_get(termio_obj);
+   if (!term)
+     return EINA_FALSE;
+   term_set_title(term);
+   return EINA_TRUE;
+}
+
 #define CB_TAB(N)                              \
 static Eina_Bool                               \
 cb_tab_##N(Evas_Object *termio_obj)            \
@@ -617,6 +627,7 @@ static Shortcut_Action _actions[] =
      {"tab_8", gettext_noop("Switch to terminal tab 8"), cb_tab_8},
      {"tab_9", gettext_noop("Switch to terminal tab 9"), cb_tab_9},
      {"tab_10", gettext_noop("Switch to terminal tab 10"), cb_tab_0},
+     {"tab_title", gettext_noop("Change title"), cb_tab_set_title},
 
      {"group", gettext_noop("Font size"), NULL},
      {"increase_font_size", gettext_noop("Font size up 1"), 
cb_increase_font_size},

-- 


Reply via email to