This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch tymux-10-quiet-head
in repository terminology.

View the commit online.

commit 671eac88049dc5bc040c174edf5ab12422ccdad0
Author: [email protected] <[email protected]>
AuthorDate: Fri Sep 25 12:46:22 2026 -0600

    win: mark terminals attached to a tymux session
    
    Nothing told a terminal showing a tymux session apart from one running
    a local shell, although the session outlives the terminal. The default
    theme now draws a thin bar on the left edge of such a terminal and of
    its entry in the tab selector, coloured by the TYMUX_INDICATOR colour
    class; themes without the part are unaffected.
    
    The state is set from one place, where the terminal's background edje
    state is applied when it is created and on every theme reload, and
    again when a terminal switches into a session or leaves it. The tab
    selector reads it when it builds its entries, as it does for the bell.
---
 data/themes/default/background.edc | 32 ++++++++++++++++++++++++++++++++
 data/themes/default/colors.edc     |  1 +
 data/themes/default/sel.edc        | 29 +++++++++++++++++++++++++++++
 src/bin/sel.c                      |  8 +++++++-
 src/bin/sel.h                      |  2 +-
 src/bin/termio.c                   | 16 ++++++++++++++++
 src/bin/termio.h                   |  4 ++++
 src/bin/termtymux.c                | 10 ++++++++++
 src/bin/termtymux.h                |  5 +++++
 src/bin/win.c                      | 25 +++++++++++++++++++++++--
 src/bin/win.h                      |  7 +++++++
 11 files changed, 135 insertions(+), 4 deletions(-)

diff --git a/data/themes/default/background.edc b/data/themes/default/background.edc
index 0b5a2937..d4f72f31 100644
--- a/data/themes/default/background.edc
+++ b/data/themes/default/background.edc
@@ -102,6 +102,38 @@ group { name: "terminology/background";
          }
       }
       ////////////////////////////////////////////////////////////////////
+      // a 1px marker on the left edge of the terminal, shown while it is
+      // attached to a tymux session (see termtymux.c); mouse_events: 0 so
+      // it never steals clicks from the content beside it.
+      part { name: "terminology.tymux_indicator"; type: RECT;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            rel1.to: "terminology.content";
+            rel2.to: "terminology.content";
+            rel2.relative: 0.0 1.0;
+            align: 0.0 0.5;
+            min: 1 1;
+            max: 1 99999;
+            color_class: "TYMUX_INDICATOR";
+            color: 90 200 90 0;
+         }
+         description { state: "visible" 0.0;
+            inherit: "default" 0.0;
+            color: 90 200 90 255;
+         }
+      }
+      program {
+         signal: "tymux,on"; source: "terminology";
+         action: STATE_SET "visible" 0.0;
+         target: "terminology.tymux_indicator";
+      }
+      program {
+         signal: "tymux,off"; source: "terminology";
+         action: STATE_SET "default" 0.0;
+         target: "terminology.tymux_indicator";
+      }
+      ////////////////////////////////////////////////////////////////////
       // indicator of other tabs and control {{{
       part { name: "tabcount_clip"; type: RECT;
          description { state: "default" 0.0;
diff --git a/data/themes/default/colors.edc b/data/themes/default/colors.edc
index c1df1591..e5cde761 100644
--- a/data/themes/default/colors.edc
+++ b/data/themes/default/colors.edc
@@ -11,6 +11,7 @@ color_class { name: "BG";               color:  32  32  32 255; }
 color_class { name: "FG";               color: 170 170 170 255; }
 color_class { name: "CURSOR";           color: 255 255 255 255; }
 color_class { name: "GLOW";             color:  51 153 255 255; }
+color_class { name: "TYMUX_INDICATOR";  color:  90 200  90 255; }
 
 color_class { name: ":bg";              color:  64  64  64 255; }
 color_class { name: ":bg-dark";         color:  32  32  32 255; }
diff --git a/data/themes/default/sel.edc b/data/themes/default/sel.edc
index c2607d69..33fb77d6 100644
--- a/data/themes/default/sel.edc
+++ b/data/themes/default/sel.edc
@@ -178,6 +178,35 @@ group { name: "terminology/sel/item";
 
       PROGRESS_BAR("terminology.content", 3)
 
+      ////////////////////////////////////////////////////////////////////
+      // marker shown while the terminal is attached to a tymux session
+      // (see termtymux.c); mirrors terminology.tymux_indicator in
+      // background.edc, sized down for the selector thumbnail.
+      part { name: "terminology.tymux_indicator"; type: RECT;
+         mouse_events: 0;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            rel.to: "terminology.content";
+            align: 0.0 0.5;
+            min: 2 1;
+            max: 2 99999;
+            color_class: "TYMUX_INDICATOR";
+            color: 90 200 90 0;
+         }
+         description { state: "visible" 0.0;
+            inherit: "default" 0.0;
+            color: 90 200 90 255;
+         }
+      }
+      program { signal: "tymux,on"; source: "terminology";
+         action: STATE_SET "visible" 0.0;
+         target: "terminology.tymux_indicator";
+      }
+      program { signal: "tymux,off"; source: "terminology";
+         action: STATE_SET "default" 0.0;
+         target: "terminology.tymux_indicator";
+      }
+
       ////////////////////////////////////////////////////////////////////
       // visual bell - spinning red siren light
       images.image: "circle-1200.png" COMP;
diff --git a/src/bin/sel.c b/src/bin/sel.c
index 107b7db0..26d5a475 100644
--- a/src/bin/sel.c
+++ b/src/bin/sel.c
@@ -730,7 +730,8 @@ sel_add(Evas_Object *parent)
 
 void *
 sel_entry_add(Evas_Object *obj, Evas_Object *entry,
-              Eina_Bool selected, Eina_Bool bell, Config *config)
+              Eina_Bool selected, Eina_Bool bell, Eina_Bool tymux,
+              Config *config)
 {
    Sel *sd = evas_object_smart_data_get(obj);
    Entry *en = calloc(1, sizeof(Entry));
@@ -763,6 +764,11 @@ sel_entry_add(Evas_Object *obj, Evas_Object *entry,
 
         edje_object_message_signal_process(en->bg);
      }
+   if (tymux)
+     {
+        edje_object_signal_emit(en->bg, "tymux,on", "terminology");
+        edje_object_message_signal_process(en->bg);
+     }
    sd->interp = 1.0;
    en->tc = evas_object_data_get(en->obj, "tc");
    if (en->tc)
diff --git a/src/bin/sel.h b/src/bin/sel.h
index c19be991..f68e6b83 100644
--- a/src/bin/sel.h
+++ b/src/bin/sel.h
@@ -4,7 +4,7 @@
 #include "config.h"
 
 Evas_Object *sel_add(Evas_Object *parent);
-void *sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Eina_Bool bell, Config *config);
+void *sel_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Eina_Bool bell, Eina_Bool tymux, Config *config);
 void sel_entry_title_set(void *entry, const char *title);
 void sel_entry_progress_set(void *entry, const char *signal, double fill);
 void sel_entry_close(void *entry);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 37a16615..17cda02f 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -4159,6 +4159,7 @@ _termio_tymux_leave(Evas_Object *obj, Termio *sd)
    sd->scroll = 0;
 
    term_tymux_pause_apply(obj); /* clears the pause overlay */
+   term_tymux_indicator_apply(obj); /* clears the session indicator */
    _smart_apply(obj);
 }
 #endif
@@ -4348,6 +4349,20 @@ termio_tymux_paused_get(const Evas_Object *obj)
 #endif
 }
 
+const char *
+termio_tymux_name_get(const Evas_Object *obj)
+{
+#ifdef HAVE_TYMUX
+   Termio *sd = evas_object_smart_data_get(obj);
+
+   if (!sd) return NULL;
+   return termtymux_name_get(sd->tymux);
+#else
+   (void)obj;
+   return NULL;
+#endif
+}
+
 #ifdef HAVE_TYMUX
 static void _smart_pty_command(void *data);
 
@@ -4448,6 +4463,7 @@ _termio_tymux_switch_job(void *data)
 
    termtymux_resize(tymux, sd->grid.w, sd->grid.h);
    term_tymux_pause_apply(obj);
+   term_tymux_indicator_apply(obj);
    _smart_apply(obj);
 }
 
diff --git a/src/bin/termio.h b/src/bin/termio.h
index e1c25fca..fa7aaba7 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -26,6 +26,10 @@ Evas_Object *termio_add(Evas_Object *parent, Config *config, const char *cmd,
  * HAVE_TYMUX. */
 Eina_Bool termio_tymux_paused_get(const Evas_Object *obj);
 
+/* obj's tymux session name, or NULL for a normal terminal, a terminal
+ * whose hand-off is still pending, or a build without HAVE_TYMUX. */
+const char *termio_tymux_name_get(const Evas_Object *obj);
+
 Termio *termio_get_from_obj(Evas_Object *obj);
 void         termio_win_set(Evas_Object *obj, Evas_Object *win);
 void         termio_theme_set(Evas_Object *obj, Evas_Object *theme);
diff --git a/src/bin/termtymux.c b/src/bin/termtymux.c
index ce1a3713..b964fd72 100644
--- a/src/bin/termtymux.c
+++ b/src/bin/termtymux.c
@@ -544,6 +544,8 @@ termtymux_new(const char *name, int cols, int rows, Config *config,
         return NULL;
      }
 
+   ts->name = eina_stringshare_add(name);
+
    *ty_out = ty;
    return ts;
 }
@@ -567,6 +569,7 @@ termtymux_free(TermTymux *ts)
    termsrv_reader_clear(&ts->reader);
    free(ts->frame_cells);
    eina_binbuf_free(ts->chord_out);
+   eina_stringshare_del(ts->name);
    if (ts->shadow_pty) termpty_free(ts->shadow_pty);
    free(ts);
 }
@@ -592,6 +595,13 @@ termtymux_end_reason_get(const TermTymux *ts)
    return ts->end_reason;
 }
 
+const char *
+termtymux_name_get(const TermTymux *ts)
+{
+   if (!ts) return NULL;
+   return ts->name;
+}
+
 /* arg is everything after "at" in ty->cur_cmd, which is also where the
  * pre-existing 'at[on/true/yes/off/false/no]' temporary-alpha command
  * (win.c _cb_command(), values "on"/"true"/"yes"/"off"/"false"/"no")
diff --git a/src/bin/termtymux.h b/src/bin/termtymux.h
index b61e94f5..b2f0c569 100644
--- a/src/bin/termtymux.h
+++ b/src/bin/termtymux.h
@@ -38,6 +38,7 @@ struct _TermTymux
    TermSrvReader     reader;
    TermSrvCell      *frame_cells; /* scratch buffer for termtymux_frame_read() */
    size_t            frame_cells_cap; /* cells frame_cells holds */
+   const char       *name;        /* eina_stringshare; the session name */
    pid_t             shell_pid;   /* daemon-side shell pid, -1 if unknown */
    Eina_Bool         paused;      /* another client hijacked the session */
    TermSrvChord      chord;       /* native Ctrl+b d detach chord state */
@@ -112,6 +113,10 @@ Eina_Bool termtymux_paused_get(const TermTymux *ts);
  * cb.exited fires. TERMTYMUX_END_DETACHED for ts == NULL. */
 TermTymuxEndReason termtymux_end_reason_get(const TermTymux *ts);
 
+/* The session's name, or NULL for ts == NULL. Owned by ts; valid until
+ * termtymux_free(). */
+const char *termtymux_name_get(const TermTymux *ts);
+
 /* Parses the argument of Terminology's private native hand-off escape,
  * "\033}at<variant>;NAME\0", where arg points right after "at":
  *   ";NAME"   -> TSRV_ATTACH_HIJACK
diff --git a/src/bin/win.c b/src/bin/win.c
index 1283c329..e28b4278 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -4739,8 +4739,9 @@ _cb_tab_selector_show(Tabs *tabs, Tab_Item *to_item)
         missed_bell = term->missed_bell;
         tab_item->selector_entry = NULL;
         tab_item->selector_entry = sel_entry_add(tabs->selector, img,
-                                                 is_selected,
-                                                 missed_bell, wn->config);
+                                                 is_selected, missed_bell,
+                                                 !!termio_tymux_name_get(term->termio),
+                                                 wn->config);
         signal = _term_progress_get(term, &fill);
         sel_entry_progress_set(tab_item->selector_entry, signal, fill);
      }
@@ -7643,6 +7644,25 @@ term_tymux_pause_apply(Evas_Object *termio)
      elm_layout_signal_emit(term->core, "pause,off", "terminology");
 }
 
+/* Shows or clears the "tymux,on"/"tymux,off" indicator on termio's
+ * terminology/background edje object (data/themes/default/background.edc)
+ * to match whether termio is currently attached to a tymux session.
+ * Called wherever termio.c sets, switches or clears sd->tymux, and from
+ * _term_bg_config() so the indicator survives a theme or config reload,
+ * which replaces term->bg's edje object and so loses any signal state it
+ * held. */
+void
+term_tymux_indicator_apply(Evas_Object *termio)
+{
+   Term *term = evas_object_data_get(termio, "term");
+
+   if (!term || !term->bg) return;
+   if (termio_tymux_name_get(termio))
+     elm_layout_signal_emit(term->bg, "tymux,on", "terminology");
+   else
+     elm_layout_signal_emit(term->bg, "tymux,off", "terminology");
+}
+
 static void
 _term_bg_config(Term *term)
 {
@@ -7722,6 +7742,7 @@ _term_bg_config(Term *term)
           }
      }
    term_tymux_pause_apply(term->termio);
+   term_tymux_indicator_apply(term->termio);
 
    DBG("is focused? tc:%p", term->container);
    if (term_is_focused(term) && (_win_is_focused(term->wn)))
diff --git a/src/bin/win.h b/src/bin/win.h
index ebe00c7f..61730c42 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -26,6 +26,13 @@ Eina_Bool term_tab_go(Term *term, int tnum);
  * object according to termio_tymux_paused_get(termio); see win.c. */
 void term_tymux_pause_apply(Evas_Object *termio);
 
+/* Shows or clears the "attached to a tymux session" indicator on termio's
+ * terminal frame according to termio_tymux_name_get(termio) being set.
+ * Called wherever termio.c attaches, switches or detaches termio's
+ * tymux session, and from _term_bg_config() so the indicator survives a
+ * theme or config reload; see win.c. */
+void term_tymux_indicator_apply(Evas_Object *termio);
+
 void split_horizontally(Evas_Object *term, const char *cmd);
 void split_vertically(Evas_Object *term, const char *cmd);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to