The branch, master has been updated
       via  c0cf4843e50ae7b123613798c209f30440d73e55 (commit)
       via  69b8f100b70061ee2520fb30368a955cf39e47db (commit)
       via  7382ba82c5b366be84ca55c7842426bcf3d1f521 (commit)
       via  e36fab2f7093e018de51af35e2c37b7a11201c2e (commit)
       via  14d8cd64455e34c1c3f5803210e1162d4a03fb48 (commit)
       via  094a047ddfe43817ac7f670668fd7d648349f6cd (commit)
      from  8794562a85ab7221b4ec3b165723faa8ca10db0a (commit)

- Log -----------------------------------------------------------------
commit c0cf4843e50ae7b123613798c209f30440d73e55
Merge: 8794562 69b8f10
Author: Thomas Adam <tho...@xteddy.org>
Commit: Thomas Adam <tho...@xteddy.org>

    Merge branch 'obsd-master'

 cmd-find.c        |   39 ++++++++++++++++++++++++++++++++-------
 cmd-select-pane.c |    6 ++----
 options-table.c   |   10 +++++-----
 server-fn.c       |    2 +-
 tmux.1            |   25 +++++++++++++------------
 tty.c             |   24 ++++++++++++++++++------
 6 files changed, 71 insertions(+), 35 deletions(-)



commit 69b8f100b70061ee2520fb30368a955cf39e47db
Author: nicm <nicm>
Commit: nicm <nicm>

    Do not complain when directions fail.
---
 cmd-select-pane.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cmd-select-pane.c b/cmd-select-pane.c
index e7f2249..f237e8f 100644
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@ -100,10 +100,8 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
                wp = window_pane_find_up(wp);
        else if (args_has(self->args, 'D'))
                wp = window_pane_find_down(wp);
-       if (wp == NULL) {
-               cmdq_error(cmdq, "pane not found");
-               return (CMD_RETURN_ERROR);
-       }
+       if (wp == NULL)
+               return (CMD_RETURN_NORMAL);
 
        if (args_has(self->args, 'e')) {
                wp->flags &= ~PANE_INPUTOFF;


commit 7382ba82c5b366be84ca55c7842426bcf3d1f521
Author: nicm <nicm>
Commit: nicm <nicm>

    If default-terminal is set to "screen" or "screen-*", emulate screen's
    historical (incorrect) behaviour for SGR 3 and send smso
    (standout). Previously, we would send sitm (italics) if the terminal
    outside had it and smso otherwise. This was acceptably until recently
    because xterm's terminfo entry lacked sitm, so most users got smso.
    
    People who want italics should set default-terminal to the forthcoming
    "tmux" entry (and be prepared to deal with it being missing on older
    hosts).
    
    As a side-effect this changes default-terminal to be a server rather
    than a session option.
    
    suggested by and ok naddy
---
 options-table.c |   10 +++++-----
 server-fn.c     |    2 +-
 tmux.1          |   25 +++++++++++++------------
 tty.c           |   24 ++++++++++++++++++------
 4 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/options-table.c b/options-table.c
index 5e21c69..089a9b8 100644
--- a/options-table.c
+++ b/options-table.c
@@ -61,6 +61,11 @@ const struct options_table_entry server_options_table[] = {
          .default_num = 20
        },
 
+       { .name = "default-terminal",
+         .type = OPTIONS_TABLE_STRING,
+         .default_str = "screen"
+       },
+
        { .name = "escape-time",
          .type = OPTIONS_TABLE_NUMBER,
          .minimum = 0,
@@ -143,11 +148,6 @@ const struct options_table_entry session_options_table[] = 
{
          .default_str = _PATH_BSHELL
        },
 
-       { .name = "default-terminal",
-         .type = OPTIONS_TABLE_STRING,
-         .default_str = "screen"
-       },
-
        { .name = "destroy-unattached",
          .type = OPTIONS_TABLE_FLAG,
          .default_num = 0
diff --git a/server-fn.c b/server-fn.c
index 85067a8..0e6e4d4 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -36,7 +36,7 @@ server_fill_environ(struct session *s, struct environ *env)
        long    pid;
 
        if (s != NULL) {
-               term = options_get_string(&s->options, "default-terminal");
+               term = options_get_string(&global_options, "default-terminal");
                environ_set(env, "TERM", term);
 
                idx = s->id;
diff --git a/tmux.1 b/tmux.1
index 5bf7782..a7f5f3e 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2266,6 +2266,19 @@ Available server options are:
 Set the number of buffers; as new buffers are added to the top of the stack,
 old ones are removed from the bottom if necessary to maintain this maximum
 length.
+.It Ic default-terminal Ar terminal
+Set the default terminal for new windows created in this session - the
+default value of the
+.Ev TERM
+environment variable.
+For
+.Nm
+to work correctly, this
+.Em must
+be set to
+.Ql screen ,
+.Ql tmux
+or a derivative of them.
 .It Ic escape-time Ar time
 Set the time in milliseconds for which
 .Nm
@@ -2405,18 +2418,6 @@ or
 This option should be configured when
 .Nm
 is used as a login shell.
-.It Ic default-terminal Ar terminal
-Set the default terminal for new windows created in this session - the
-default value of the
-.Ev TERM
-environment variable.
-For
-.Nm
-to work correctly, this
-.Em must
-be set to
-.Ql screen
-or a derivative of it.
 .It Xo Ic destroy-unattached
 .Op Ic on | off
 .Xc
diff --git a/tty.c b/tty.c
index ee52d03..f6db8e2 100644
--- a/tty.c
+++ b/tty.c
@@ -34,6 +34,7 @@
 void   tty_read_callback(struct bufferevent *, void *);
 void   tty_error_callback(struct bufferevent *, short, void *);
 
+void   tty_set_italics(struct tty *);
 int    tty_try_256(struct tty *, u_char, const char *);
 
 void   tty_colours(struct tty *, const struct grid_cell *);
@@ -457,6 +458,21 @@ tty_putn(struct tty *tty, const void *buf, size_t len, 
u_int width)
 }
 
 void
+tty_set_italics(struct tty *tty)
+{
+       const char      *s;
+
+       if (tty_term_has(tty->term, TTYC_SITM)) {
+               s = options_get_string(&global_options, "default-terminal");
+               if (strcmp(s, "screen") != 0 && strncmp(s, "screen-", 7) != 0) {
+                       tty_putcode(tty, TTYC_SITM);
+                       return;
+               }
+       }
+       tty_putcode(tty, TTYC_SMSO);
+}
+
+void
 tty_set_title(struct tty *tty, const char *title)
 {
        if (!tty_term_has(tty->term, TTYC_TSL) ||
@@ -1396,12 +1412,8 @@ tty_attributes(struct tty *tty, const struct grid_cell 
*gc,
                tty_putcode(tty, TTYC_BOLD);
        if (changed & GRID_ATTR_DIM)
                tty_putcode(tty, TTYC_DIM);
-       if (changed & GRID_ATTR_ITALICS) {
-               if (tty_term_has(tty->term, TTYC_SITM))
-                       tty_putcode(tty, TTYC_SITM);
-               else
-                       tty_putcode(tty, TTYC_SMSO);
-       }
+       if (changed & GRID_ATTR_ITALICS)
+               tty_set_italics(tty);
        if (changed & GRID_ATTR_UNDERSCORE)
                tty_putcode(tty, TTYC_SMUL);
        if (changed & GRID_ATTR_BLINK)


commit e36fab2f7093e018de51af35e2c37b7a11201c2e
Author: nicm <nicm>
Commit: nicm <nicm>

    If looking for an index, don't fill in window when given a session.
---
 cmd-find.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cmd-find.c b/cmd-find.c
index e9d80cb..ec4cf6c 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -434,9 +434,11 @@ cmd_find_get_window(struct cmd_find_state *fs, const char 
*window)
 
        /* Otherwise try as a session itself. */
        if (cmd_find_get_session(fs, window) == 0) {
-               fs->wl = fs->s->curw;
-               fs->idx = fs->wl->idx;
-               fs->w = fs->wl->window;
+               if (~fs->flags & CMD_FIND_WINDOW_INDEX) {
+                       fs->wl = fs->s->curw;
+                       fs->w = fs->wl->window;
+                       fs->idx = fs->wl->idx;
+               }
                return (0);
        }
 


commit 14d8cd64455e34c1c3f5803210e1162d4a03fb48
Author: nicm <nicm>
Commit: nicm <nicm>

    Do not do a search for the tty path if there isn't one.
---
 cmd-find.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/cmd-find.c b/cmd-find.c
index e937b6d..e9d80cb 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -243,10 +243,13 @@ cmd_find_current_session_with_client(struct 
cmd_find_state *fs)
        struct window_pane      *wp;
 
        /* If this is running in a pane, that's great. */
-       RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
-               if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
-                       break;
-       }
+       if (fs->cmdq->client->tty.path != NULL) {
+               RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
+                       if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
+                               break;
+               }
+       } else
+               wp = NULL;
 
        /* Not running in a pane. We know nothing. Find the best session. */
        if (wp == NULL) {


commit 094a047ddfe43817ac7f670668fd7d648349f6cd
Author: nicm <nicm>
Commit: nicm <nicm>

    If can't find pane as a pane, try as a window; likewise if can't find
    window as a session.
---
 cmd-find.c |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/cmd-find.c b/cmd-find.c
index f7c1ba7..e937b6d 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -426,7 +426,18 @@ cmd_find_get_window(struct cmd_find_state *fs, const char 
*window)
        fs->s = fs->current->s;
 
        /* We now only need to find the winlink in this session. */
-       return (cmd_find_get_window_with_session(fs, window));
+       if (cmd_find_get_window_with_session(fs, window) == 0)
+               return (0);
+
+       /* Otherwise try as a session itself. */
+       if (cmd_find_get_session(fs, window) == 0) {
+               fs->wl = fs->s->curw;
+               fs->idx = fs->wl->idx;
+               fs->w = fs->wl->window;
+               return (0);
+       }
+
+       return (-1);
 }
 
 /*
@@ -592,14 +603,23 @@ cmd_find_get_pane(struct cmd_find_state *fs, const char 
*pane)
                return (cmd_find_best_session_with_window(fs));
        }
 
-       /* Not a pane id, so use the current session and window. */
+       /* Not a pane id, so try the current session and window. */
        fs->s = fs->current->s;
        fs->wl = fs->current->wl;
        fs->idx = fs->current->idx;
        fs->w = fs->current->w;
 
        /* We now only need to find the pane in this window. */
-       return (cmd_find_get_pane_with_window(fs, pane));
+       if (cmd_find_get_pane_with_window(fs, pane) == 0)
+               return (0);
+
+       /* Otherwise try as a window itself (this will also try as session). */
+       if (cmd_find_get_window(fs, pane) == 0) {
+               fs->wp = fs->w->active;
+               return (0);
+       }
+
+       return (-1);
 }
 
 /*


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

Summary of changes:
 cmd-find.c        |   39 ++++++++++++++++++++++++++++++++-------
 cmd-select-pane.c |    6 ++----
 options-table.c   |   10 +++++-----
 server-fn.c       |    2 +-
 tmux.1            |   25 +++++++++++++------------
 tty.c             |   24 ++++++++++++++++++------
 6 files changed, 71 insertions(+), 35 deletions(-)


hooks/post-receive
-- 
tmux

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to