The branch, master has been updated
       via  00af2df1027301a31531321c12eae6ff32989a3a (commit)
       via  972da2d498d6e410fd97c55fb422af7caf464622 (commit)
       via  e44bd9f750bc374ae116a849e7ccde4efabc034a (commit)
      from  be390c19913a84be7114ce4188006c8ac26b6345 (commit)

- Log -----------------------------------------------------------------
commit 00af2df1027301a31531321c12eae6ff32989a3a
Merge: be390c1 972da2d
Author: Thomas <[email protected]>
Commit: Thomas <[email protected]>

    Merge branch 'obsd-master'

 cmd-if-shell.c     |    9 +++++++++
 cmd-run-shell.c    |    9 +++++++++
 cmd-split-window.c |   17 ++++-------------
 names.c            |   24 ++++++++++--------------
 options-table.c    |    5 -----
 tmux.1             |    7 -------
 window.c           |   11 +----------
 7 files changed, 33 insertions(+), 49 deletions(-)



commit 972da2d498d6e410fd97c55fb422af7caf464622
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Try to establish client for run-shell and if-shell if no -t.
---
 cmd-if-shell.c  |    9 +++++++++
 cmd-run-shell.c |    9 +++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index a3ca655..e810b0f 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -59,6 +59,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
        struct args                     *args = self->args;
        struct cmd_if_shell_data        *cdata;
        char                            *shellcmd;
+       struct client                   *c;
        struct session                  *s = NULL;
        struct winlink                  *wl = NULL;
        struct window_pane              *wp = NULL;
@@ -66,6 +67,14 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
 
        if (args_has(args, 't'))
                wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
+       else {
+               c = cmd_find_client(cmdq, NULL, 1);
+               if (c != NULL && c->session != NULL) {
+                       s = c->session;
+                       wl = s->curw;
+                       wp = wl->window->active;
+               }
+       }
 
        ft = format_create();
        if (s != NULL)
diff --git a/cmd-run-shell.c b/cmd-run-shell.c
index e78d0e4..ef1dbdd 100644
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@ -77,6 +77,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
        struct args                     *args = self->args;
        struct cmd_run_shell_data       *cdata;
        char                            *shellcmd;
+       struct client                   *c;
        struct session                  *s = NULL;
        struct winlink                  *wl = NULL;
        struct window_pane              *wp = NULL;
@@ -84,6 +85,14 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
 
        if (args_has(args, 't'))
                wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
+       else {
+               c = cmd_find_client(cmdq, NULL, 1);
+               if (c != NULL && c->session != NULL) {
+                       s = c->session;
+                       wl = s->curw;
+                       wp = wl->window->active;
+               }
+       }
 
        ft = format_create();
        if (s != NULL)


commit e44bd9f750bc374ae116a849e7ccde4efabc034a
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>

    Revert the command-prefix change which breaks sequences of commands.
---
 cmd-split-window.c |   17 ++++-------------
 names.c            |   24 ++++++++++--------------
 options-table.c    |    5 -----
 tmux.1             |    7 -------
 window.c           |   11 +----------
 5 files changed, 15 insertions(+), 49 deletions(-)

diff --git a/cmd-split-window.c b/cmd-split-window.c
index e3d6f6e..98bbd42 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -59,8 +59,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
        struct window           *w;
        struct window_pane      *wp, *new_wp = NULL;
        struct environ           env;
-       const char              *cmd, *cwd, *shell, *prefix;
-       char                    *cause, *new_cause, *cmd1;
+       const char              *cmd, *cwd, *shell;
+       char                    *cause, *new_cause;
        u_int                    hlimit;
        int                      size, percentage;
        enum layout_type         type;
@@ -123,18 +123,9 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
                goto error;
        }
        new_wp = window_add_pane(w, hlimit);
-
-       if (*cmd != '\0') {
-               prefix = options_get_string(&w->options, "command-prefix");
-               xasprintf(&cmd1, "%s%s", prefix, cmd);
-       } else
-               cmd1 = xstrdup("");
-       if (window_pane_spawn(new_wp, cmd1, shell, cwd, &env, s->tio,
-           &cause) != 0) {
-               free(cmd1);
+       if (window_pane_spawn(
+           new_wp, cmd, shell, cwd, &env, s->tio, &cause) != 0)
                goto error;
-       }
-       free(cmd1);
        layout_assign_pane(lc, new_wp);
 
        server_redraw_window(w);
diff --git a/names.c b/names.c
index ce5d0c5..76dec82 100644
--- a/names.c
+++ b/names.c
@@ -26,8 +26,8 @@
 
 #include "tmux.h"
 
-void    window_name_callback(int, short, void *);
-char   *parse_window_name(struct window *, const char *);
+void    window_name_callback(unused int, unused short, void *);
+char   *parse_window_name(const char *);
 
 void
 queue_window_name(struct window *w)
@@ -73,9 +73,9 @@ window_name_callback(unused int fd, unused short events, void 
*data)
                 */
                if (w->active->cmd != NULL && *w->active->cmd == '\0' &&
                    name != NULL && name[0] == '-' && name[1] != '\0')
-                       wname = parse_window_name(w, name + 1);
+                       wname = parse_window_name(name + 1);
                else
-                       wname = parse_window_name(w, name);
+                       wname = parse_window_name(name);
                free(name);
        }
 
@@ -98,22 +98,18 @@ default_window_name(struct window *w)
        if (w->active->screen != &w->active->base)
                return (xstrdup("[tmux]"));
        if (w->active->cmd != NULL && *w->active->cmd != '\0')
-               return (parse_window_name(w, w->active->cmd));
-       return (parse_window_name(w, w->active->shell));
+               return (parse_window_name(w->active->cmd));
+       return (parse_window_name(w->active->shell));
 }
 
 char *
-parse_window_name(struct window *w, const char *in)
+parse_window_name(const char *in)
 {
-       char    *copy, *name, *ptr, *prefix;
-       size_t   prefixlen;
-
-       prefix = options_get_string(&w->options, "command-prefix");
-       prefixlen = strlen(prefix);
+       char    *copy, *name, *ptr;
 
        name = copy = xstrdup(in);
-       if (strncmp(name, prefix, prefixlen) == 0)
-               name = name + prefixlen;
+       if (strncmp(name, "exec ", (sizeof "exec ") - 1) == 0)
+               name = name + (sizeof "exec ") - 1;
 
        while (*name == ' ')
                name++;
diff --git a/options-table.c b/options-table.c
index 5f9c81b..ae71188 100644
--- a/options-table.c
+++ b/options-table.c
@@ -502,11 +502,6 @@ const struct options_table_entry window_options_table[] = {
          .default_num = 1
        },
 
-       { .name = "command-prefix",
-         .type = OPTIONS_TABLE_STRING,
-         .default_str = "exec "
-       },
-
        { .name = "force-height",
          .type = OPTIONS_TABLE_NUMBER,
          .minimum = 0,
diff --git a/tmux.1 b/tmux.1
index 5d4864d..0dc68bf 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2750,13 +2750,6 @@ Set clock colour.
 .Xc
 Set clock hour format.
 .Pp
-.It Ic command-prefix Ar string
-String prefixed to commands (apart from a plain shell as set by the
-.Ic default-shell
-option).
-The default is
-.Ql "exec\ " .
-.Pp
 .It Ic force-height Ar height
 .It Ic force-width Ar width
 Prevent
diff --git a/window.c b/window.c
index 0ab3603..0f445ed 100644
--- a/window.c
+++ b/window.c
@@ -314,24 +314,15 @@ window_create(const char *name, const char *cmd, const 
char *shell,
 {
        struct window           *w;
        struct window_pane      *wp;
-       const char              *prefix;
-       char                    *cmd1;
 
        w = window_create1(sx, sy);
        wp = window_add_pane(w, hlimit);
        layout_init(w, wp);
 
-       if (*cmd != '\0') {
-               prefix = options_get_string(&w->options, "command-prefix");
-               xasprintf(&cmd1, "%s%s", prefix, cmd);
-       } else
-               cmd1 = xstrdup("");
-       if (window_pane_spawn(wp, cmd1, shell, cwd, env, tio, cause) != 0) {
+       if (window_pane_spawn(wp, cmd, shell, cwd, env, tio, cause) != 0) {
                window_destroy(w);
-               free(cmd1);
                return (NULL);
        }
-       free(cmd1);
 
        w->active = TAILQ_FIRST(&w->panes);
        if (name != NULL) {


-----------------------------------------------------------------------

Summary of changes:
 cmd-if-shell.c     |    9 +++++++++
 cmd-run-shell.c    |    9 +++++++++
 cmd-split-window.c |   17 ++++-------------
 names.c            |   24 ++++++++++--------------
 options-table.c    |    5 -----
 tmux.1             |    7 -------
 window.c           |   11 +----------
 7 files changed, 33 insertions(+), 49 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to