This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux
in repository terminology.
View the commit online.
commit 7cc6d47c7333487c9dc38dfe594a25537cd5ac2b
Author: [email protected] <[email protected]>
AuthorDate: Sun Jun 21 19:47:22 2026 -0600
feat(tymux): display session name in terminal tab and window title
When a terminal is attached to a tymux session, the tab label and
window title now show the session name in brackets before the shell
title: "[session_name] shell_title". If the shell title is empty,
only the session name is displayed: "[session_name]". Non-tymux
terminals remain unchanged.
This is implemented by introducing termio_tymux_name_get() to expose
the tymux session name, and _term_display_title_get() to compose the
display title with the session name prefix. Both title-setting paths
(_solo_focus and _cb_title) route through the new helper function.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
---
src/bin/termio.c | 13 +++++++++++++
src/bin/termio.h | 1 +
src/bin/win.c | 33 +++++++++++++++++++++++++++++----
3 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 71e50254..02a26ec9 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -261,6 +261,19 @@ termio_title_get(const Evas_Object *obj)
return sd->pty->prop.title;
}
+const char *
+termio_tymux_name_get(const Evas_Object *obj)
+{
+#ifdef HAVE_TYMUX
+ Termio *sd = evas_object_smart_data_get(obj);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sd, NULL);
+ return sd->tymux_name;
+#else
+ (void)obj;
+ return NULL;
+#endif
+}
+
const char *
termio_user_title_get(const Evas_Object *obj)
{
diff --git a/src/bin/termio.h b/src/bin/termio.h
index 83bbfbbd..00fc1845 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -53,6 +53,7 @@ Evas_Object *termio_textgrid_get(const Evas_Object *obj);
Evas_Object *termio_win_get(const Evas_Object *obj);
Evas_Object *termio_get_cursor(const Evas_Object *obj);
const char *termio_title_get(const Evas_Object *obj);
+const char *termio_tymux_name_get(const Evas_Object *obj);
const char *termio_user_title_get(const Evas_Object *obj);
void termio_user_title_set(Evas_Object *obj, const char *title);
const char *termio_icon_name_get(const Evas_Object *obj);
diff --git a/src/bin/win.c b/src/bin/win.c
index f5e333c8..651bb70d 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -745,6 +745,25 @@ _solo_unfocus(Term_Container *tc, Term_Container *relative)
}
}
+/* Build the title displayed in the tab and window title bar. When the
+ * terminal is attached to a tymux session, the session name is shown in
+ * brackets ahead of the regular shell title: "[session] shell title".
+ * Returns a stringshare (caller must eina_stringshare_del) or NULL. */
+static const char *
+_term_display_title_get(Term *term)
+{
+ const char *title = termio_title_get(term->termio);
+ const char *tymux_name = termio_tymux_name_get(term->termio);
+
+ if (tymux_name && *tymux_name)
+ {
+ if (title && *title)
+ return eina_stringshare_printf("[%s] %s", tymux_name, title);
+ return eina_stringshare_printf("[%s]", tymux_name);
+ }
+ return title ? eina_stringshare_ref(title) : NULL;
+}
+
static void
_solo_focus(Term_Container *tc, Term_Container *relative)
{
@@ -787,9 +806,12 @@ _solo_focus(Term_Container *tc, Term_Container *relative)
termio_event_feed_mouse_in(term->termio);
termio_focus_in(term->termio);
- title = termio_title_get(term->termio);
+ title = _term_display_title_get(term);
if (title)
- tc->set_title(tc, tc, title);
+ {
+ tc->set_title(tc, tc, title);
+ eina_stringshare_del(title);
+ }
if (term->missed_bell)
term->missed_bell = EINA_FALSE;
@@ -6737,10 +6759,13 @@ _cb_title(void *data,
{
Term *term = data;
Term_Container *tc = term->container;
- const char *title = termio_title_get(term->termio);
+ const char *title = _term_display_title_get(term);
if (title)
- tc->set_title(tc, tc, title);
+ {
+ tc->set_title(tc, tc, title);
+ eina_stringshare_del(title);
+ }
}
static void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.