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 20809abc6ee0e9dc5ebd65c8aede86b422558ed8
Author: [email protected] <[email protected]>
AuthorDate: Mon Mar 16 09:10:58 2026 -0600

    feat: thread session name from CLI to termio_add() for tymux connection
    
    Add --session=<name> CLI option to allow users to connect the first
    terminal pane to a persistent tymux session. The session name flows
    from Ecore_Getopt parsing → Ipc_Instance.session → term_new() →
    termio_add(), where it will be used by Task 10 to initiate recovery.
    
    Splits and new tabs pass NULL (do not inherit the session), as they
    are child containers within an existing window.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/bin/ipc.h    |  3 +++
 src/bin/main.c   | 23 +++++++++++++++++++++--
 src/bin/termio.c |  3 ++-
 src/bin/termio.h |  3 ++-
 src/bin/win.c    | 10 +++++-----
 src/bin/win.h    |  3 ++-
 6 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/src/bin/ipc.h b/src/bin/ipc.h
index f9b43305..a5a9257c 100644
--- a/src/bin/ipc.h
+++ b/src/bin/ipc.h
@@ -19,6 +19,9 @@ struct tag_Ipc_Instance
    char *font;
    char *startup_id;
    char *startup_split;
+#ifdef HAVE_TYMUX
+   char *session;    /* --session <name>: connect to tymux session */
+#endif
    int x, y, w, h;
    Eina_Bool pos;
    Eina_Bool login_shell;
diff --git a/src/bin/main.c b/src/bin/main.c
index 5384e26c..ad679fb4 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -419,7 +419,13 @@ main_ipc_new(Ipc_Instance *inst)
    if (inst->h <= 0) inst->h = 24;
    term = term_new(wn, config, inst->cmd, inst->login_shell,
                    inst->cd, inst->w, inst->h, inst->hold,
-                   inst->title);
+                   inst->title,
+#ifdef HAVE_TYMUX
+                   inst->session
+#else
+                   NULL
+#endif
+                   );
    if (!term)
      {
         CRITICAL(_("Could not create terminal widget"));
@@ -521,6 +527,10 @@ static Ecore_Getopt options = {
                               gettext_noop("Highlight links")),
       ECORE_GETOPT_STORE_BOOL('\0', "no-wizard",
                               gettext_noop("Do not display wizard on start up")),
+#ifdef HAVE_TYMUX
+      ECORE_GETOPT_STORE_STR('\0', "session",
+                             gettext_noop("Attach first terminal to a named persistent tymux session")),
+#endif
 
       ECORE_GETOPT_VERSION   ('V', "version"),
       ECORE_GETOPT_COPYRIGHT ('\0', "copyright"),
@@ -607,7 +617,13 @@ _start(Ipc_Instance *instance, Eina_Bool need_scale_wizard)
 
    term = term_new(wn, config, instance->cmd, instance->login_shell,
                    instance->cd,
-                   instance->w, instance->h, instance->hold, instance->title);
+                   instance->w, instance->h, instance->hold, instance->title,
+#ifdef HAVE_TYMUX
+                   instance->session
+#else
+                   NULL
+#endif
+                   );
    if (!term)
      {
         CRITICAL(_("Could not create terminal widget"));
@@ -854,6 +870,9 @@ elm_main(int argc, char **argv)
      ECORE_GETOPT_VALUE_DOUBLE(scale),                  /* --scale */
      ECORE_GETOPT_VALUE_BOOL(instance.active_links),    /* --active-links */
      ECORE_GETOPT_VALUE_BOOL(no_wizard),                /* --no-wizard */
+#ifdef HAVE_TYMUX
+     ECORE_GETOPT_VALUE_STR(instance.session),          /* --session */
+#endif
 
      ECORE_GETOPT_VALUE_BOOL(quit_option),              /* -v, --version */
      ECORE_GETOPT_VALUE_BOOL(quit_option),              /* --copyright */
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 77bca231..7836e00b 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -4277,7 +4277,8 @@ _gesture_layer_death(void *data,
 Evas_Object *
 termio_add(Evas_Object *win, Config *config,
            const char *cmd, Eina_Bool login_shell, const char *cd,
-           int w, int h, Term *term, const char *title)
+           int w, int h, Term *term, const char *title,
+           const char *session_name EINA_UNUSED)
 {
    Evas *e;
    Evas_Object *obj, *g;
diff --git a/src/bin/termio.h b/src/bin/termio.h
index 0e16cd1d..4d3cc780 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -12,7 +12,8 @@
 
 Evas_Object *termio_add(Evas_Object *parent, Config *config, const char *cmd,
                         Eina_Bool login_shell, const char *cd, int w, int h,
-                        Term *term, const char *title);
+                        Term *term, const char *title,
+                        const char *session_name);
 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/win.c b/src/bin/win.c
index 808bf06d..3e868a9f 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1546,7 +1546,7 @@ _win_split(Term_Container *tc, Term_Container *child,
           }
         tm_new = term_new(wn, wn->config,
                           cmd, wn->config->login_shell, wdir,
-                          80, 24, EINA_FALSE, NULL);
+                          80, 24, EINA_FALSE, NULL, NULL);
         tc_solo_new = _solo_new(tm_new, wn);
         evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio);
 
@@ -2910,7 +2910,7 @@ _split_split(Term_Container *tc, Term_Container *child,
      }
    tm_new = term_new(wn, wn->config,
                      cmd, wn->config->login_shell, wdir,
-                     80, 24, EINA_FALSE, NULL);
+                     80, 24, EINA_FALSE, NULL, NULL);
    tc_solo_new = _solo_new(tm_new, wn);
    evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio);
 
@@ -5044,7 +5044,7 @@ _tab_new_cb(void *data,
 
    tm_new = term_new(wn, wn->config,
                      NULL, wn->config->login_shell, wdir,
-                     80, 24, EINA_FALSE, NULL);
+                     80, 24, EINA_FALSE, NULL, NULL);
    tc_new = _solo_new(tm_new, wn);
    evas_object_data_set(tm_new->termio, "sizedone", tm_new->termio);
 
@@ -7391,7 +7391,7 @@ Term *
 term_new(Win *wn, Config *config, const char *cmd,
          Eina_Bool login_shell, const char *cd,
          int size_w, int size_h, Eina_Bool hold,
-         const char *title)
+         const char *title, const char *session_name)
 {
    Term *term;
    Evas_Object *o;
@@ -7446,7 +7446,7 @@ term_new(Win *wn, Config *config, const char *cmd,
    _term_trans(term);
 
    term->termio = o = termio_add(wn->win, config, cmd, login_shell, cd,
-                                 size_w, size_h, term, title);
+                                 size_w, size_h, term, title, session_name);
    evas_object_data_set(o, "term", term);
    colors_term_init(termio_textgrid_get(term->termio),
                     term->config->color_scheme);
diff --git a/src/bin/win.h b/src/bin/win.h
index bac95987..a90ec9ee 100644
--- a/src/bin/win.h
+++ b/src/bin/win.h
@@ -34,7 +34,8 @@ void windows_update(void);
 
 Term *term_new(Win *wn, Config *config, const char *cmd,
                Eina_Bool login_shell, const char *cd, int size_w, int size_h,
-               Eina_Bool hold, const char *title);
+               Eina_Bool hold, const char *title,
+               const char *session_name);
 int win_term_set(Win *wn, Term *term);
 
 Eina_List *

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

Reply via email to