Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tmux/dist merge conflicts



details:   https://anonhg.NetBSD.org/src/rev/3052f757c7be
branches:  trunk
changeset: 846348:3052f757c7be
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 12 21:02:28 2019 +0000

description:
merge conflicts

diffstat:

 external/bsd/tmux/dist/client.c              |     6 +-
 external/bsd/tmux/dist/cmd-attach-session.c  |     2 +
 external/bsd/tmux/dist/cmd-capture-pane.c    |     5 +-
 external/bsd/tmux/dist/cmd-display-message.c |    27 +-
 external/bsd/tmux/dist/cmd-if-shell.c        |    15 +-
 external/bsd/tmux/dist/cmd-load-buffer.c     |     1 +
 external/bsd/tmux/dist/cmd-new-session.c     |    58 +-
 external/bsd/tmux/dist/cmd-queue.c           |    22 +-
 external/bsd/tmux/dist/cmd-send-keys.c       |    59 +-
 external/bsd/tmux/dist/cmd-show-messages.c   |    22 +-
 external/bsd/tmux/dist/cmd-show-options.c    |     2 -
 external/bsd/tmux/dist/cmd-split-window.c    |     2 +-
 external/bsd/tmux/dist/cmd-string.c          |    39 +-
 external/bsd/tmux/dist/cmd-wait-for.c        |     4 +-
 external/bsd/tmux/dist/colour.c              |    11 +-
 external/bsd/tmux/dist/environ.c             |    20 +-
 external/bsd/tmux/dist/format.c              |  1028 +++++++++++++++++-----
 external/bsd/tmux/dist/grid.c                |   221 +++-
 external/bsd/tmux/dist/input-keys.c          |     4 +-
 external/bsd/tmux/dist/input.c               |   371 +++++--
 external/bsd/tmux/dist/job.c                 |   104 ++-
 external/bsd/tmux/dist/key-bindings.c        |     7 +-
 external/bsd/tmux/dist/mode-tree.c           |    21 +-
 external/bsd/tmux/dist/options.c             |   238 ++--
 external/bsd/tmux/dist/screen-write.c        |   316 +++----
 external/bsd/tmux/dist/screen.c              |    70 +-
 external/bsd/tmux/dist/server-client.c       |   377 ++++++--
 external/bsd/tmux/dist/server-fn.c           |    12 +-
 external/bsd/tmux/dist/session.c             |    21 +-
 external/bsd/tmux/dist/status.c              |   737 ++++++----------
 external/bsd/tmux/dist/style.c               |     7 +-
 external/bsd/tmux/dist/tmux.1                |   549 +++++++++---
 external/bsd/tmux/dist/tmux.c                |    29 +-
 external/bsd/tmux/dist/tmux.h                |   377 +++++--
 external/bsd/tmux/dist/tty-keys.c            |   120 ++-
 external/bsd/tmux/dist/tty-term.c            |    69 +-
 external/bsd/tmux/dist/tty.c                 |   714 ++++++++++++---
 external/bsd/tmux/dist/utf8.c                |    60 -
 external/bsd/tmux/dist/window-buffer.c       |    38 +-
 external/bsd/tmux/dist/window-client.c       |    63 +-
 external/bsd/tmux/dist/window-copy.c         |  1144 +++++++++++++------------
 external/bsd/tmux/dist/window-tree.c         |    64 +-
 external/bsd/tmux/dist/window.c              |   190 ++-
 external/bsd/tmux/dist/xmalloc.h             |     8 +-
 44 files changed, 4600 insertions(+), 2654 deletions(-)

diffs (truncated from 13420 to 300 lines):

diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/client.c
--- a/external/bsd/tmux/dist/client.c   Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/client.c   Tue Nov 12 21:02:28 2019 +0000
@@ -222,7 +222,7 @@
        const char              *ttynam, *cwd;
        pid_t                    ppid;
        enum msgtype             msg;
-       char                    *cause, path[PATH_MAX];
+       char                    *cause;
        struct termios           tio, saved_tio;
        size_t                   size;
 
@@ -277,9 +277,7 @@
        client_peer = proc_add_peer(client_proc, fd, client_dispatch, NULL);
 
        /* Save these before pledge(). */
-       if ((cwd = getenv("PWD")) == NULL &&
-           (cwd = getcwd(path, sizeof path)) == NULL &&
-           (cwd = find_home()) == NULL)
+       if ((cwd = find_cwd()) == NULL && (cwd = find_home()) == NULL)
                cwd = "/";
        if ((ttynam = ttyname(STDIN_FILENO)) == NULL)
                ttynam = "";
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-attach-session.c
--- a/external/bsd/tmux/dist/cmd-attach-session.c       Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-attach-session.c       Tue Nov 12 21:02:28 2019 +0000
@@ -115,6 +115,7 @@
                c->session = s;
                if (~item->shared->flags & CMDQ_SHARED_REPEAT)
                        server_client_set_key_table(c, NULL);
+               tty_update_client_offset(c);
                status_timer_start(c);
                notify_client("client-session-changed", c);
                session_update_activity(s, NULL);
@@ -142,6 +143,7 @@
 
                c->session = s;
                server_client_set_key_table(c, NULL);
+               tty_update_client_offset(c);
                status_timer_start(c);
                notify_client("client-session-changed", c);
                session_update_activity(s, NULL);
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-capture-pane.c
--- a/external/bsd/tmux/dist/cmd-capture-pane.c Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-capture-pane.c Tue Nov 12 21:02:28 2019 +0000
@@ -41,7 +41,7 @@
 
        .args = { "ab:CeE:JpPqS:t:", 0, 0 },
        .usage = "[-aCeJpPq] " CMD_BUFFER_USAGE " [-E end-line] "
-                "[-S start-line]" CMD_TARGET_PANE_USAGE,
+                "[-S start-line] " CMD_TARGET_PANE_USAGE,
 
        .target = { 't', CMD_FIND_PANE, 0 },
 
@@ -199,8 +199,7 @@
        size_t                   len;
 
        if (self->entry == &cmd_clear_history_entry) {
-               if (wp->mode == &window_copy_mode)
-                       window_pane_reset_mode(wp);
+               window_pane_reset_mode_all(wp);
                grid_clear_history(wp->base.grid);
                return (CMD_RETURN_NORMAL);
        }
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-display-message.c
--- a/external/bsd/tmux/dist/cmd-display-message.c      Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-display-message.c      Tue Nov 12 21:02:28 2019 +0000
@@ -39,8 +39,8 @@
        .name = "display-message",
        .alias = "display",
 
-       .args = { "c:pt:F:", 0, 1 },
-       .usage = "[-p] [-c target-client] [-F format] "
+       .args = { "ac:pt:F:v", 0, 1 },
+       .usage = "[-apv] [-c target-client] [-F format] "
                 CMD_TARGET_PANE_USAGE " [message]",
 
        .target = { 't', CMD_FIND_PANE, 0 },
@@ -49,6 +49,14 @@
        .exec = cmd_display_message_exec
 };
 
+static void
+cmd_display_message_each(const char *key, const char *value, void *arg)
+{
+       struct cmdq_item        *item = arg;
+
+       cmdq_print(item, "%s=%s", key, value);
+}
+
 static enum cmd_retval
 cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
 {
@@ -60,6 +68,7 @@
        const char              *template;
        char                    *msg;
        struct format_tree      *ft;
+       int                      flags;
 
        if (args_has(args, 'F') && args->argc != 0) {
                cmdq_error(item, "only one of -F or argument must be given");
@@ -83,10 +92,20 @@
                target_c = c;
        else
                target_c = cmd_find_best_client(s);
-       ft = format_create(item->client, item, FORMAT_NONE, 0);
+       if (args_has(self->args, 'v'))
+               flags = FORMAT_VERBOSE;
+       else
+               flags = 0;
+       ft = format_create(item->client, item, FORMAT_NONE, flags);
        format_defaults(ft, target_c, s, wl, wp);
 
-       msg = format_expand_time(ft, template, time(NULL));
+       if (args_has(args, 'a')) {
+               if (item != NULL)
+                       format_each(ft, cmd_display_message_each, item);
+               return (CMD_RETURN_NORMAL);
+       }
+
+       msg = format_expand_time(ft, template);
        if (args_has(self->args, 'p'))
                cmdq_print(item, "%s", msg);
        else if (c != NULL)
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-if-shell.c
--- a/external/bsd/tmux/dist/cmd-if-shell.c     Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-if-shell.c     Tue Nov 12 21:02:28 2019 +0000
@@ -120,8 +120,13 @@
                cdata->item = NULL;
        memcpy(&cdata->mouse, &shared->mouse, sizeof cdata->mouse);
 
-       job_run(shellcmd, s, server_client_get_cwd(item->client, s), NULL,
-           cmd_if_shell_callback, cmd_if_shell_free, cdata, 0);
+       if (job_run(shellcmd, s, server_client_get_cwd(item->client, s), NULL,
+           cmd_if_shell_callback, cmd_if_shell_free, cdata, 0) == NULL) {
+               cmdq_error(item, "failed to run command: %s", shellcmd);
+               free(shellcmd);
+               free(cdata);
+               return (CMD_RETURN_ERROR);
+       }
        free(shellcmd);
 
        if (args_has(args, 'b'))
@@ -132,14 +137,16 @@
 static void
 cmd_if_shell_callback(struct job *job)
 {
-       struct cmd_if_shell_data        *cdata = job->data;
+       struct cmd_if_shell_data        *cdata = job_get_data(job);
        struct client                   *c = cdata->client;
        struct cmd_list                 *cmdlist;
        struct cmdq_item                *new_item;
        char                            *cause, *cmd, *file = cdata->file;
        u_int                            line = cdata->line;
+       int                              status;
 
-       if (!WIFEXITED(job->status) || WEXITSTATUS(job->status) != 0)
+       status = job_get_status(job);
+       if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
                cmd = cdata->cmd_else;
        else
                cmd = cdata->cmd_if;
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-load-buffer.c
--- a/external/bsd/tmux/dist/cmd-load-buffer.c  Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-load-buffer.c  Tue Nov 12 21:02:28 2019 +0000
@@ -87,6 +87,7 @@
                if (error != 0) {
                        cmdq_error(item, "-: %s", cause);
                        free(cause);
+                       free(cdata);
                        return (CMD_RETURN_ERROR);
                }
                return (CMD_RETURN_WAIT);
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-new-session.c
--- a/external/bsd/tmux/dist/cmd-new-session.c  Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-new-session.c  Tue Nov 12 21:02:28 2019 +0000
@@ -71,14 +71,15 @@
        struct session          *s, *as, *groupwith;
        struct window           *w;
        struct environ          *env;
+       struct options          *oo;
        struct termios           tio, *tiop;
        struct session_group    *sg;
        const char              *errstr, *template, *group, *prefix;
-       const char              *path, *cmd, *tmp;
+       const char              *path, *cmd, *tmp, *value;
        char                   **argv, *cause, *cp, *newname, *cwd = NULL;
        int                      detached, already_attached, idx, argc;
        int                      is_control = 0;
-       u_int                    sx, sy;
+       u_int                    sx, sy, dsx = 80, dsy = 24;
        struct environ_entry    *envent;
        struct cmd_find_state    fs;
        enum cmd_retval          retval;
@@ -189,44 +190,51 @@
                }
        }
 
-       /* Find new session size. */
-       if (!detached) {
-               sx = c->tty.sx;
-               sy = c->tty.sy;
-               if (!is_control &&
-                   sy > 0 &&
-                   options_get_number(global_s_options, "status"))
-                       sy--;
-       } else {
-               sx = 80;
-               sy = 24;
-       }
-       if ((is_control || detached) && args_has(args, 'x')) {
+       /* Get default session size. */
+       if (args_has(args, 'x')) {
                tmp = args_get(args, 'x');
                if (strcmp(tmp, "-") == 0) {
                        if (c != NULL)
-                               sx = c->tty.sx;
+                               dsx = c->tty.sx;
                } else {
-                       sx = strtonum(tmp, 1, USHRT_MAX, &errstr);
+                       dsx = strtonum(tmp, 1, USHRT_MAX, &errstr);
                        if (errstr != NULL) {
                                cmdq_error(item, "width %s", errstr);
                                goto error;
                        }
                }
        }
-       if ((is_control || detached) && args_has(args, 'y')) {
+       if (args_has(args, 'y')) {
                tmp = args_get(args, 'y');
                if (strcmp(tmp, "-") == 0) {
                        if (c != NULL)
-                               sy = c->tty.sy;
+                               dsy = c->tty.sy;
                } else {
-                       sy = strtonum(tmp, 1, USHRT_MAX, &errstr);
+                       dsy = strtonum(tmp, 1, USHRT_MAX, &errstr);
                        if (errstr != NULL) {
                                cmdq_error(item, "height %s", errstr);
                                goto error;
                        }
                }
        }
+
+       /* Find new session size. */
+       if (!detached && !is_control) {
+               sx = c->tty.sx;
+               sy = c->tty.sy;
+               if (sy > 0 && options_get_number(global_s_options, "status"))
+                       sy--;
+       } else {
+               value = options_get_string(global_s_options, "default-size");
+               if (sscanf(value, "%ux%u", &sx, &sy) != 2) {
+                       sx = 80;
+                       sy = 24;
+               }
+               if (args_has(args, 'x'))
+                       sx = dsx;
+               if (args_has(args, 'y'))
+                       sy = dsy;
+       }
        if (sx == 0)
                sx = 1;
        if (sy == 0)
@@ -262,10 +270,15 @@
        if (c != NULL && !args_has(args, 'E'))
                environ_update(global_s_options, c->environ, env);
 
+       /* Set up the options. */
+       oo = options_create(global_s_options);
+       if (args_has(args, 'x') || args_has(args, 'y'))
+               options_set_string(oo, "default-size", 0, "%ux%u", dsx, dsy);
+
        /* Create the new session. */
        idx = -1 - options_get_number(global_s_options, "base-index");
-       s = session_create(prefix, newname, argc, argv, path, cwd, env, tiop,
-           idx, sx, sy, &cause);
+       s = session_create(prefix, newname, argc, argv, path, cwd, env, oo,
+           tiop, idx, &cause);
        environ_free(env);
        if (s == NULL) {
                cmdq_error(item, "create session failed: %s", cause);
@@ -313,6 +326,7 @@
                c->session = s;
                if (~item->shared->flags & CMDQ_SHARED_REPEAT)
                        server_client_set_key_table(c, NULL);
+               tty_update_client_offset(c);
                status_timer_start(c);
                notify_client("client-session-changed", c);
                session_update_activity(s, NULL);
diff -r 2e79fd4a04cb -r 3052f757c7be external/bsd/tmux/dist/cmd-queue.c
--- a/external/bsd/tmux/dist/cmd-queue.c        Tue Nov 12 20:59:46 2019 +0000
+++ b/external/bsd/tmux/dist/cmd-queue.c        Tue Nov 12 21:02:28 2019 +0000
@@ -404,10 +404,11 @@
 void
 cmdq_print(struct cmdq_item *item, const char *fmt, ...)
 {
-       struct client   *c = item->client;
-       struct window   *w;
-       va_list          ap;



Home | Main Index | Thread Index | Old Index