The branch, master has been updated via 370cf75458e7736920559870d8ccff1d4bcee755 (commit) via 4a7587931ce54aa1a94a104480113d658c295b6b (commit) via eec27f9257976d063db279594bff264c2e32d52c (commit) via f922920609063ff5ac1ee11a48bf8f1bd13e8d16 (commit) via 0cd55eb1e7823a75810b7f43f53b6266cb8b0bc0 (commit) via 009a5e4213a04555be0fb654f80fe8685082ba20 (commit) via 6920be311b276277ad7c38a96ccca4746b94bd95 (commit) via 3aa72b42b2a317b0ae531219d269f2a636d6482a (commit) via 02df86079b1f3155313ebb6f891cf6cf593d3ad9 (commit) via cd9ccbc1e98b48fd8bfb64356664313a8eb1f7b0 (commit) from 5e956f114819294e03166e6c66128feb6e0571a2 (commit)
- Log ----------------------------------------------------------------- commit 370cf75458e7736920559870d8ccff1d4bcee755 Merge: 5e956f1 4a75879 Author: Thomas Adam <tho...@xteddy.org> Commit: Thomas Adam <tho...@xteddy.org> Merge branch 'obsd-master' client.c | 6 ++-- cmd-bind-key.c | 28 ++++++++++++++++++----- cmd-capture-pane.c | 2 +- cmd-respawn-pane.c | 2 +- colour.c | 2 +- format.c | 63 +++++++++++++++++++++++++++++---------------------- input-keys.c | 2 +- input.c | 2 +- paste.c | 6 ++-- server-client.c | 2 +- server-fn.c | 4 +- server-window.c | 6 ++-- style.c | 12 ++++++++- tmux.1 | 28 +++++++++++++++++----- tty.c | 36 ++++++++++++++-------------- window-choose.c | 2 +- window-copy.c | 29 ++++++++++++++++++----- 17 files changed, 147 insertions(+), 85 deletions(-) commit 4a7587931ce54aa1a94a104480113d658c295b6b Author: nicm <nicm> Commit: nicm <nicm> Fix some issues in bright colour handling. Bold background doesn't exist so there is no reason for tty_check_bg to mess with the BRIGHT flag at all, ever. Also use aixterm colours for 256-to-16 translation if the terminal supports them. And there is no reason for tty_colours_bg to worry about whether the terminal supports them - tty_check_bg has already taken care of it. --- tty.c | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tty.c b/tty.c index 05d422d..83ae828 100644 --- a/tty.c +++ b/tty.c @@ -1453,6 +1453,8 @@ tty_check_fg(struct tty *tty, struct grid_cell *gc) { u_int colours; + colours = tty_term_number(tty->term, TTYC_COLORS); + /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_FG256) { /* And not a 256 colour mode? */ @@ -1461,7 +1463,10 @@ tty_check_fg(struct tty *tty, struct grid_cell *gc) gc->fg = colour_256to16(gc->fg); if (gc->fg & 8) { gc->fg &= 7; - gc->attr |= GRID_ATTR_BRIGHT; + if (colours >= 16) + gc->fg += 90; + else + gc->attr |= GRID_ATTR_BRIGHT; } else gc->attr &= ~GRID_ATTR_BRIGHT; gc->flags &= ~GRID_FLAG_FG256; @@ -1470,7 +1475,6 @@ tty_check_fg(struct tty *tty, struct grid_cell *gc) } /* Is this an aixterm colour? */ - colours = tty_term_number(tty->term, TTYC_COLORS); if (gc->fg >= 90 && gc->fg <= 97 && colours < 16) { gc->fg -= 90; gc->attr |= GRID_ATTR_BRIGHT; @@ -1482,6 +1486,8 @@ tty_check_bg(struct tty *tty, struct grid_cell *gc) { u_int colours; + colours = tty_term_number(tty->term, TTYC_COLORS); + /* Is this a 256-colour colour? */ if (gc->flags & GRID_FLAG_BG256) { /* @@ -1492,20 +1498,19 @@ tty_check_bg(struct tty *tty, struct grid_cell *gc) if (!(tty->term->flags & TERM_256COLOURS) && !(tty->term_flags & TERM_256COLOURS)) { gc->bg = colour_256to16(gc->bg); - if (gc->bg & 8) + if (gc->bg & 8) { gc->bg &= 7; - gc->attr &= ~GRID_ATTR_BRIGHT; + if (colours >= 16) + gc->fg += 90; + } gc->flags &= ~GRID_FLAG_BG256; } return; } /* Is this an aixterm colour? */ - colours = tty_term_number(tty->term, TTYC_COLORS); - if (gc->bg >= 90 && gc->bg <= 97 && colours < 16) { + if (gc->bg >= 90 && gc->bg <= 97 && colours < 16) gc->bg -= 90; - gc->attr |= GRID_ATTR_BRIGHT; - } } void @@ -1559,14 +1564,9 @@ tty_colours_bg(struct tty *tty, const struct grid_cell *gc) /* Is this an aixterm bright colour? */ if (bg >= 90 && bg <= 97) { - /* 16 colour terminals or above only. */ - if (tty_term_number(tty->term, TTYC_COLORS) >= 16) { - xsnprintf(s, sizeof s, "\033[%dm", bg + 10); - tty_puts(tty, s); - goto save_bg; - } - bg -= 90; - /* no such thing as a bold background */ + xsnprintf(s, sizeof s, "\033[%dm", bg + 10); + tty_puts(tty, s); + goto save_bg; } /* Otherwise set the background colour. */ commit eec27f9257976d063db279594bff264c2e32d52c Author: nicm <nicm> Commit: nicm <nicm> Use tty_term_flag not _has for flags, also fix a typo (position not permission). --- tty.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index 1bb8981..05d422d 100644 --- a/tty.c +++ b/tty.c @@ -629,7 +629,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy) sx = tty->sx; /* - * Don't move the cursor to the start permission if it will wrap there + * Don't move the cursor to the start position if it will wrap there * itself. */ gl = NULL; @@ -1407,7 +1407,7 @@ tty_colours(struct tty *tty, const struct grid_cell *gc) * * Otherwise, try to set the default colour only as needed. */ - have_ax = tty_term_has(tty->term, TTYC_AX); + have_ax = tty_term_flag(tty->term, TTYC_AX); if (!have_ax && tty_term_has(tty->term, TTYC_OP)) tty_reset(tty); else { commit f922920609063ff5ac1ee11a48bf8f1bd13e8d16 Author: nicm <nicm> Commit: nicm <nicm> Fix setting old-style window -fg/-bg/-attr options that aren't global. --- style.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/style.c b/style.c index d8ab07a..5534f11 100644 --- a/style.c +++ b/style.c @@ -160,13 +160,21 @@ style_update_new(struct options *oo, const char *name, const char *newname) { int value; struct grid_cell *gc; + struct options_entry *o; /* It's a colour or attribute, but with no -style equivalent. */ if (newname == NULL) return; - gc = options_get_style(oo, newname); - value = options_get_number(oo, name); + o = options_find1(oo, newname); + if (o == NULL) + o = options_set_style (oo, newname, "default", 0); + gc = &o->style; + + o = options_find1(oo, name); + if (o == NULL) + o = options_set_number (oo, name, 8); + value = o->num; if (strstr(name, "-bg") != NULL) colour_set_bg(gc, value); commit 0cd55eb1e7823a75810b7f43f53b6266cb8b0bc0 Author: nicm <nicm> Commit: nicm <nicm> Add a -x flag to copy-selection, append-selection and start-named-buffer to prevent it exiting copy mode after copying. From J Raynor with a few tweaks by me. --- cmd-bind-key.c | 28 ++++++++++++++++++++++------ tmux.1 | 18 +++++++++++++++--- window-copy.c | 27 +++++++++++++++++++++------ 3 files changed, 58 insertions(+), 15 deletions(-) diff --git a/cmd-bind-key.c b/cmd-bind-key.c index 5d68d48..47c58e5 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -104,18 +104,34 @@ cmd_bind_key_mode_table(struct cmd *self, struct cmd_q *cmdq, int key) return (CMD_RETURN_ERROR); } - if (cmd != MODEKEYCOPY_COPYPIPE) { - if (args->argc != 2) { - cmdq_error(cmdq, "no argument allowed"); - return (CMD_RETURN_ERROR); + switch (cmd) { + case MODEKEYCOPY_APPENDSELECTION: + case MODEKEYCOPY_COPYSELECTION: + case MODEKEYCOPY_STARTNAMEDBUFFER: + if (args->argc == 2) + arg = NULL; + else { + arg = args->argv[2]; + if (strcmp(arg, "-x") != 0) { + cmdq_error(cmdq, "unknown argument"); + return (CMD_RETURN_ERROR); + } } - arg = NULL; - } else { + break; + case MODEKEYCOPY_COPYPIPE: if (args->argc != 3) { cmdq_error(cmdq, "no argument given"); return (CMD_RETURN_ERROR); } arg = args->argv[2]; + break; + default: + if (args->argc != 2) { + cmdq_error(cmdq, "no argument allowed"); + return (CMD_RETURN_ERROR); + } + arg = NULL; + break; } mtmp.key = key; diff --git a/tmux.1 b/tmux.1 index 2764626..abdeba5 100644 --- a/tmux.1 +++ b/tmux.1 @@ -987,15 +987,27 @@ command and keys modified or removed with .Ic bind-key and .Ic unbind-key . -One command accepts an argument, -.Ic copy-pipe , -which copies the selection and pipes it to a command. +If +.Ic append-selection , +.Ic copy-selection , +or +.Ic start-named-buffer +are given the +.Fl x +flag, +.Nm +will not exit copy mode after copying. +.Ic copy-pipe +copies the selection and pipes it to a command. For example the following will bind +.Ql C-w +not to exit after copying and .Ql C-q to copy the selection into .Pa /tmp as well as the paste buffer: .Bd -literal -offset indent +bind-key -temacs-copy C-w copy-selection -x bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out" .Ed .Pp diff --git a/window-copy.c b/window-copy.c index 074e731..feb8c48 100644 --- a/window-copy.c +++ b/window-copy.c @@ -147,6 +147,7 @@ struct window_copy_mode_data { enum window_copy_input_type inputtype; const char *inputprompt; char *inputstr; + int inputexit; int numprefix; @@ -424,8 +425,12 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) case MODEKEYCOPY_APPENDSELECTION: if (sess != NULL) { window_copy_append_selection(wp, NULL); - window_pane_reset_mode(wp); - return; + if (arg == NULL) { + window_pane_reset_mode(wp); + return; + } + window_copy_clear_selection(wp); + window_copy_redraw_screen(wp); } break; case MODEKEYCOPY_CANCEL: @@ -572,8 +577,12 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) case MODEKEYCOPY_COPYSELECTION: if (sess != NULL) { window_copy_copy_selection(wp, NULL); - window_pane_reset_mode(wp); - return; + if (arg == NULL) { + window_pane_reset_mode(wp); + return; + } + window_copy_clear_selection(wp); + window_copy_redraw_screen(wp); } break; case MODEKEYCOPY_STARTOFLINE: @@ -718,6 +727,7 @@ window_copy_key(struct window_pane *wp, struct session *sess, int key) goto input_on; case MODEKEYCOPY_STARTNAMEDBUFFER: data->inputtype = WINDOW_COPY_NAMEDBUFFER; + data->inputexit = (arg == NULL); data->inputprompt = "Buffer"; *data->inputstr = '\0'; goto input_on; @@ -828,8 +838,13 @@ window_copy_key_input(struct window_pane *wp, int key) case WINDOW_COPY_NAMEDBUFFER: window_copy_copy_selection(wp, data->inputstr); *data->inputstr = '\0'; - window_pane_reset_mode(wp); - return (0); + if (data->inputexit) { + window_pane_reset_mode(wp); + return (0); + } + window_copy_clear_selection(wp); + window_copy_redraw_screen(wp); + break; case WINDOW_COPY_GOTOLINE: window_copy_goto_line(wp, data->inputstr); *data->inputstr = '\0'; commit 009a5e4213a04555be0fb654f80fe8685082ba20 Author: nicm <nicm> Commit: nicm <nicm> in the case -> in this case. --- tmux.1 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tmux.1 b/tmux.1 index c8fab92..2764626 100644 --- a/tmux.1 +++ b/tmux.1 @@ -747,7 +747,7 @@ behave like .Ic attach-session if .Ar session-name -already exists; in the case, +already exists; in this case, .Fl D behaves like .Fl d commit 6920be311b276277ad7c38a96ccca4746b94bd95 Author: nicm <nicm> Commit: nicm <nicm> When replacing, don't free the old paste until after the new one's name has been copied. Fixes a use-after-free in window-copy.c. Bug reported by J Raynor (who also provided a different fix). --- paste.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paste.c b/paste.c index de80115..2ccc3cd 100644 --- a/paste.c +++ b/paste.c @@ -247,9 +247,6 @@ paste_set(char *data, size_t size, const char *name, char **cause) return (-1); } - pb = paste_get_name(name); - if (pb != NULL) - paste_free_name(name); pb = xmalloc(sizeof *pb); @@ -261,6 +258,9 @@ paste_set(char *data, size_t size, const char *name, char **cause) pb->automatic = 0; pb->order = paste_next_order++; + if (paste_get_name(name) != NULL) + paste_free_name(name); + RB_INSERT(paste_name_tree, &paste_by_name, pb); RB_INSERT(paste_time_tree, &paste_by_time, pb); commit 3aa72b42b2a317b0ae531219d269f2a636d6482a Author: nicm <nicm> Commit: nicm <nicm> Add a helper function to convert time, and add session_activity formats (the latter from Takatoshi Matsumoto). --- format.c | 33 +++++++++++++++++++++------------ tmux.1 | 2 ++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/format.c b/format.c index 9227175..cf1713b 100644 --- a/format.c +++ b/format.c @@ -37,6 +37,7 @@ int format_replace(struct format_tree *, const char *, size_t, char **, size_t *, size_t *); +char *format_time_string(time_t); char *format_get_command(struct window_pane *); void format_defaults_pane_tabs(struct format_tree *, struct window_pane *); @@ -453,6 +454,18 @@ format_get_command(struct window_pane *wp) return (out); } +/* Get time as a string. */ +char * +format_time_string(time_t t) +{ + char *tim; + + tim = ctime(&t); + *strchr(tim, '\n') = '\0'; + + return (tim); +} + /* Set defaults for any of arguments that are not NULL. */ void format_defaults(struct format_tree *ft, struct client *c, struct session *s, @@ -480,7 +493,6 @@ void format_defaults_session(struct format_tree *ft, struct session *s) { struct session_group *sg; - char *tim; time_t t; ft->s = s; @@ -498,9 +510,11 @@ format_defaults_session(struct format_tree *ft, struct session *s) t = s->creation_time.tv_sec; format_add(ft, "session_created", "%lld", (long long) t); - tim = ctime(&t); - *strchr(tim, '\n') = '\0'; - format_add(ft, "session_created_string", "%s", tim); + format_add(ft, "session_created_string", "%s", format_time_string(t)); + + t = s->activity_time.tv_sec; + format_add(ft, "session_activity", "%lld", (long long) t); + format_add(ft, "session_activity_string", "%s", format_time_string(t)); format_add(ft, "session_attached", "%u", s->attached); format_add(ft, "session_many_attached", "%d", s->attached > 1); @@ -510,9 +524,8 @@ format_defaults_session(struct format_tree *ft, struct session *s) void format_defaults_client(struct format_tree *ft, struct client *c) { - char *tim; - time_t t; struct session *s; + time_t t; if (ft->s == NULL) ft->s = c->session; @@ -526,15 +539,11 @@ format_defaults_client(struct format_tree *ft, struct client *c) t = c->creation_time.tv_sec; format_add(ft, "client_created", "%lld", (long long) t); - tim = ctime(&t); - *strchr(tim, '\n') = '\0'; - format_add(ft, "client_created_string", "%s", tim); + format_add(ft, "client_created_string", "%s", format_time_string(t)); t = c->activity_time.tv_sec; format_add(ft, "client_activity", "%lld", (long long) t); - tim = ctime(&t); - *strchr(tim, '\n') = '\0'; - format_add(ft, "client_activity_string", "%s", tim); + format_add(ft, "client_activity_string", "%s", format_time_string(t)); format_add(ft, "client_prefix", "%d", !!(c->flags & CLIENT_PREFIX)); diff --git a/tmux.1 b/tmux.1 index 7052484..c8fab92 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3148,6 +3148,8 @@ The following variables are available, where appropriate: .It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane" .It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane" .It Li "session_attached" Ta "" Ta "Number of clients session is attached to" +.It Li "session_activity" Ta "" Ta "Integer time of session last activity" +.It Li "session_activity_string" Ta "" Ta "String time of session last activity" .It Li "session_created" Ta "" Ta "Integer time session created" .It Li "session_created_string" Ta "" Ta "String time session created" .It Li "session_group" Ta "" Ta "Number of session group" commit 02df86079b1f3155313ebb6f891cf6cf593d3ad9 Author: nicm <nicm> Commit: nicm <nicm> Fix some format specifier nits, from Ben Boeckel. --- client.c | 6 +++--- cmd-capture-pane.c | 2 +- cmd-respawn-pane.c | 2 +- colour.c | 2 +- format.c | 30 +++++++++++++++--------------- input-keys.c | 2 +- input.c | 2 +- server-client.c | 2 +- server-fn.c | 4 ++-- server-window.c | 6 +++--- window-choose.c | 2 +- window-copy.c | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/client.c b/client.c index 5458dfc..6d4b8a5 100644 --- a/client.c +++ b/client.c @@ -557,7 +557,7 @@ client_dispatch_wait(void *data0) data = imsg.data; datalen = imsg.hdr.len - IMSG_HEADER_SIZE; - log_debug("got %d from server", imsg.hdr.type); + log_debug("got %u from server", imsg.hdr.type); switch (imsg.hdr.type) { case MSG_EXIT: case MSG_SHUTDOWN: @@ -604,7 +604,7 @@ client_dispatch_wait(void *data0) fatalx("bad MSG_VERSION size"); fprintf(stderr, "protocol version mismatch " - "(client %u, server %u)\n", PROTOCOL_VERSION, + "(client %d, server %u)\n", PROTOCOL_VERSION, imsg.hdr.peerid); client_exitval = 1; @@ -648,7 +648,7 @@ client_dispatch_attached(void) data = imsg.data; datalen = imsg.hdr.len - IMSG_HEADER_SIZE; - log_debug("got %d from server", imsg.hdr.type); + log_debug("got %u from server", imsg.hdr.type); switch (imsg.hdr.type) { case MSG_DETACH: case MSG_DETACHKILL: diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index ce60b4c..b44ebe9 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -74,7 +74,7 @@ cmd_capture_pane_pending(struct args *args, struct window_pane *wp, tmp[0] = line[i]; tmp[1] = '\0'; } else - xsnprintf(tmp, sizeof tmp, "\\%03o", line[i]); + xsnprintf(tmp, sizeof tmp, "\\%03hho", line[i]); buf = cmd_capture_pane_append(buf, len, tmp, strlen(tmp)); } diff --git a/cmd-respawn-pane.c b/cmd-respawn-pane.c index 4703153..6575e8e 100644 --- a/cmd-respawn-pane.c +++ b/cmd-respawn-pane.c @@ -59,7 +59,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq) if (!args_has(self->args, 'k') && wp->fd != -1) { if (window_pane_index(wp, &idx) != 0) fatalx("index not found"); - cmdq_error(cmdq, "pane still active: %s:%u.%u", + cmdq_error(cmdq, "pane still active: %s:%d.%u", s->name, wl->idx, idx); return (CMD_RETURN_ERROR); } diff --git a/colour.c b/colour.c index b5efd6f..82f8533 100644 --- a/colour.c +++ b/colour.c @@ -147,7 +147,7 @@ colour_tostring(int c) static char s[32]; if (c & 0x100) { - xsnprintf(s, sizeof s, "colour%u", c & ~0x100); + xsnprintf(s, sizeof s, "colour%d", c & ~0x100); return (s); } diff --git a/format.c b/format.c index 01fa3ad..9227175 100644 --- a/format.c +++ b/format.c @@ -503,7 +503,7 @@ format_defaults_session(struct format_tree *ft, struct session *s) format_add(ft, "session_created_string", "%s", tim); format_add(ft, "session_attached", "%u", s->attached); - format_add(ft, "session_many_attached", "%u", s->attached > 1); + format_add(ft, "session_many_attached", "%d", s->attached > 1); } /* Set default format keys for a client. */ @@ -572,7 +572,7 @@ format_defaults_window(struct format_tree *ft, struct window *w) format_add(ft, "window_height", "%u", w->sy); format_add(ft, "window_layout", "%s", layout); format_add(ft, "window_panes", "%u", window_count_panes(w)); - format_add(ft, "window_zoomed_flag", "%u", + format_add(ft, "window_zoomed_flag", "%d", !!(w->flags & WINDOW_ZOOMED)); free(layout); @@ -597,13 +597,13 @@ format_defaults_winlink(struct format_tree *ft, struct session *s, format_add(ft, "window_flags", "%s", flags); format_add(ft, "window_active", "%d", wl == s->curw); - format_add(ft, "window_bell_flag", "%u", + format_add(ft, "window_bell_flag", "%d", !!(wl->flags & WINLINK_BELL)); - format_add(ft, "window_activity_flag", "%u", + format_add(ft, "window_activity_flag", "%d", !!(wl->flags & WINLINK_ACTIVITY)); - format_add(ft, "window_silence_flag", "%u", + format_add(ft, "window_silence_flag", "%d", !!(wl->flags & WINLINK_SILENCE)); - format_add(ft, "window_last_flag", "%u", + format_add(ft, "window_last_flag", "%d", !!(wl == TAILQ_FIRST(&s->lastw))); free(flags); @@ -623,7 +623,7 @@ format_defaults_pane_tabs(struct format_tree *ft, struct window_pane *wp) if (EVBUFFER_LENGTH(buffer) > 0) evbuffer_add(buffer, ",", 1); - evbuffer_add_printf(buffer, "%d", i); + evbuffer_add_printf(buffer, "%u", i); } format_add(ft, "pane_tabs", "%.*s", (int) EVBUFFER_LENGTH(buffer), @@ -694,16 +694,16 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp) free(cmd); } - format_add(ft, "cursor_x", "%d", wp->base.cx); - format_add(ft, "cursor_y", "%d", wp->base.cy); - format_add(ft, "scroll_region_upper", "%d", wp->base.rupper); - format_add(ft, "scroll_region_lower", "%d", wp->base.rlower); - format_add(ft, "saved_cursor_x", "%d", wp->ictx.old_cx); - format_add(ft, "saved_cursor_y", "%d", wp->ictx.old_cy); + format_add(ft, "cursor_x", "%u", wp->base.cx); + format_add(ft, "cursor_y", "%u", wp->base.cy); + format_add(ft, "scroll_region_upper", "%u", wp->base.rupper); + format_add(ft, "scroll_region_lower", "%u", wp->base.rlower); + format_add(ft, "saved_cursor_x", "%u", wp->ictx.old_cx); + format_add(ft, "saved_cursor_y", "%u", wp->ictx.old_cy); format_add(ft, "alternate_on", "%d", wp->saved_grid ? 1 : 0); - format_add(ft, "alternate_saved_x", "%d", wp->saved_cx); - format_add(ft, "alternate_saved_y", "%d", wp->saved_cy); + format_add(ft, "alternate_saved_x", "%u", wp->saved_cx); + format_add(ft, "alternate_saved_y", "%u", wp->saved_cy); format_add(ft, "cursor_flag", "%d", !!(wp->base.mode & MODE_CURSOR)); diff --git a/input-keys.c b/input-keys.c index 040a060..f2d010d 100644 --- a/input-keys.c +++ b/input-keys.c @@ -219,7 +219,7 @@ input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m) * legacy format. */ if (m->sgr && (wp->screen->mode & MODE_MOUSE_SGR)) { - len = xsnprintf(buf, sizeof buf, "\033[<%d;%d;%d%c", + len = xsnprintf(buf, sizeof buf, "\033[<%u;%u;%u%c", m->sgr_xb, m->x + 1, m->y + 1, m->sgr_rel ? 'm' : 'M'); } else if (wp->screen->mode & MODE_MOUSE_UTF8) { diff --git a/input.c b/input.c index de11f62..9f7d441 100644 --- a/input.c +++ b/input.c @@ -1717,7 +1717,7 @@ void input_exit_osc(struct input_ctx *ictx) { u_char *p = ictx->input_buf; - int option; + u_int option; if (ictx->flags & INPUT_DISCARD) return; diff --git a/server-client.c b/server-client.c index 280815c..8373a0e 100644 --- a/server-client.c +++ b/server-client.c @@ -824,7 +824,7 @@ server_client_msg_dispatch(struct client *c) continue; } - log_debug("got %d from client %d", imsg.hdr.type, c->ibuf.fd); + log_debug("got %u from client %d", imsg.hdr.type, c->ibuf.fd); switch (imsg.hdr.type) { case MSG_IDENTIFY_FLAGS: case MSG_IDENTIFY_TERM: diff --git a/server-fn.c b/server-fn.c index b8cdb31..f89eca8 100644 --- a/server-fn.c +++ b/server-fn.c @@ -41,9 +41,9 @@ server_fill_environ(struct session *s, struct environ *env) idx = s->id; } else - idx = -1; + idx = (u_int)-1; pid = getpid(); - xsnprintf(var, sizeof var, "%s,%ld,%d", socket_path, pid, idx); + xsnprintf(var, sizeof var, "%s,%ld,%u", socket_path, pid, idx); environ_set(env, "TMUX", var); } diff --git a/server-window.c b/server-window.c index a14c315..a235570 100644 --- a/server-window.c +++ b/server-window.c @@ -90,7 +90,7 @@ server_window_check_bell(struct session *s, struct winlink *wl) if (c->session->curw->window == w) status_message_set(c, "Bell in current window"); else if (action == BELL_ANY) - status_message_set(c, "Bell in window %u", wl->idx); + status_message_set(c, "Bell in window %d", wl->idx); } return (1); @@ -124,7 +124,7 @@ server_window_check_activity(struct session *s, struct winlink *wl) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session != s) continue; - status_message_set(c, "Activity in window %u", wl->idx); + status_message_set(c, "Activity in window %d", wl->idx); } } @@ -175,7 +175,7 @@ server_window_check_silence(struct session *s, struct winlink *wl) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session != s) continue; - status_message_set(c, "Silence in window %u", wl->idx); + status_message_set(c, "Silence in window %d", wl->idx); } } diff --git a/window-choose.c b/window-choose.c index 6914167..8bed8d4 100644 --- a/window-choose.c +++ b/window-choose.c @@ -98,7 +98,7 @@ window_choose_add(struct window_pane *wp, struct window_choose_data *wcd) item->pos = ARRAY_LENGTH(&data->list) - 1; item->state = 0; - data->width = xsnprintf(tmp, sizeof tmp , "%u", item->pos); + data->width = xsnprintf(tmp, sizeof tmp , "%d", item->pos); } void diff --git a/window-copy.c b/window-copy.c index 223df88..074e731 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1216,7 +1216,7 @@ window_copy_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, limit = screen_size_x(s) + 1; if (data->inputtype == WINDOW_COPY_NUMERICPREFIX) { xoff = size = xsnprintf(hdr, limit, - "Repeat: %u", data->numprefix); + "Repeat: %d", data->numprefix); } else { xoff = size = xsnprintf(hdr, limit, "%s: %s", data->inputprompt, data->inputstr); commit cd9ccbc1e98b48fd8bfb64356664313a8eb1f7b0 Author: nicm <nicm> Commit: nicm <nicm> set-titles-string now uses formats, not the status bits (so no #() for now). Reported by landry. --- tmux.1 | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tmux.1 b/tmux.1 index ca7d392..7052484 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2499,9 +2499,9 @@ variable is set. String used to set the window title if .Ic set-titles is on. -Character sequences are replaced as for the -.Ic status-left -option. +Formats are expanded, see the +.Sx FORMATS +section. .It Xo Ic status .Op Ic on | off .Xc ----------------------------------------------------------------------- Summary of changes: client.c | 6 ++-- cmd-bind-key.c | 28 ++++++++++++++++++----- cmd-capture-pane.c | 2 +- cmd-respawn-pane.c | 2 +- colour.c | 2 +- format.c | 63 +++++++++++++++++++++++++++++---------------------- input-keys.c | 2 +- input.c | 2 +- paste.c | 6 ++-- server-client.c | 2 +- server-fn.c | 4 +- server-window.c | 6 ++-- style.c | 12 ++++++++- tmux.1 | 28 +++++++++++++++++----- tty.c | 36 ++++++++++++++-------------- window-choose.c | 2 +- window-copy.c | 29 ++++++++++++++++++----- 17 files changed, 147 insertions(+), 85 deletions(-) hooks/post-receive -- tmux ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs