diff -Nru tmux-2.0/debian/changelog tmux-2.0/debian/changelog --- tmux-2.0/debian/changelog 2015-05-21 18:21:39.000000000 +0000 +++ tmux-2.0/debian/changelog 2015-05-23 10:52:28.000000000 +0000 @@ -1,3 +1,14 @@ +tmux (2.0-3) unstable; urgency=medium + + * Cherry-pick more fixes from upstream Git: + + f60d88cd24: use standout instead of italics for SGR3, like screen does + (closes: #756353) + + a0cfbf8522: set up client signal handler earlier to avoid zombies + + 8c0867fce0: use-after-free in paste/window-copy + + 70f783ff56: doc fix for set-titles-string + + -- Romain Francoise Sat, 23 May 2015 12:40:52 +0200 + tmux (2.0-2) unstable; urgency=medium * Cherry-pick 2c53b23d59 from upstream Git to fix missing cursor in Emacs diff -Nru tmux-2.0/debian/patches/series tmux-2.0/debian/patches/series --- tmux-2.0/debian/patches/series 2015-05-21 18:03:14.000000000 +0000 +++ tmux-2.0/debian/patches/series 2015-05-23 10:30:35.000000000 +0000 @@ -1,3 +1,7 @@ platform-quirks.diff lintian-manpage-hyphen.diff upstream-2c53b23d59.diff +upstream-70f783ff56.diff +upstream-8c0867fce0.diff +upstream-a0cfbf8522.diff +upstream-f60d88cd24.diff diff -Nru tmux-2.0/debian/patches/upstream-70f783ff56.diff tmux-2.0/debian/patches/upstream-70f783ff56.diff --- tmux-2.0/debian/patches/upstream-70f783ff56.diff 1970-01-01 00:00:00.000000000 +0000 +++ tmux-2.0/debian/patches/upstream-70f783ff56.diff 2015-05-23 10:33:36.000000000 +0000 @@ -0,0 +1,25 @@ +From 70f783ff56b11e858c5abc8c3dc9344d394725ad Mon Sep 17 00:00:00 2001 +From: nicm +Date: Wed, 11 Mar 2015 08:17:37 +0000 +Subject: set-titles-string now uses formats, not the status bits (so no + #() for now). Reported by landry. + +--- + tmux.1 | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/tmux.1 ++++ b/tmux.1 +@@ -2503,9 +2503,9 @@ + 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 diff -Nru tmux-2.0/debian/patches/upstream-8c0867fce0.diff tmux-2.0/debian/patches/upstream-8c0867fce0.diff --- tmux-2.0/debian/patches/upstream-8c0867fce0.diff 1970-01-01 00:00:00.000000000 +0000 +++ tmux-2.0/debian/patches/upstream-8c0867fce0.diff 2015-05-23 10:33:31.000000000 +0000 @@ -0,0 +1,33 @@ +From 8c0867fce0e2642d8f8ef005e88fffca685a6768 Mon Sep 17 00:00:00 2001 +From: nicm +Date: Tue, 7 Apr 2015 13:06:22 +0000 +Subject: 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 file changed, 3 insertions(+), 3 deletions(-) + +--- a/paste.c ++++ b/paste.c +@@ -246,9 +246,6 @@ + return (-1); + } + +- pb = paste_get_name(name); +- if (pb != NULL) +- paste_free_name(name); + + pb = xmalloc(sizeof *pb); + +@@ -260,6 +257,9 @@ + 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); + diff -Nru tmux-2.0/debian/patches/upstream-a0cfbf8522.diff tmux-2.0/debian/patches/upstream-a0cfbf8522.diff --- tmux-2.0/debian/patches/upstream-a0cfbf8522.diff 1970-01-01 00:00:00.000000000 +0000 +++ tmux-2.0/debian/patches/upstream-a0cfbf8522.diff 2015-05-23 10:33:09.000000000 +0000 @@ -0,0 +1,32 @@ +From a0cfbf8522b66ef9158cea6c803196f3ca058e8e Mon Sep 17 00:00:00 2001 +From: nicm +Date: Fri, 24 Apr 2015 20:58:44 +0000 +Subject: Set up signal handler earlier so that we don't get zombies, + reported by sobrado@. + +--- + client.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/client.c ++++ b/client.c +@@ -258,6 +258,9 @@ + return (1); + } + ++ /* Establish signal handlers. */ ++ set_signals(client_signal); ++ + /* Initialize the client socket and start the server. */ + fd = client_connect(socket_path, cmdflags & CMD_STARTSERVER); + if (fd == -1) { +@@ -300,9 +303,6 @@ + tcsetattr(STDIN_FILENO, TCSANOW, &tio); + } + +- /* Establish signal handlers. */ +- set_signals(client_signal); +- + /* Send identify messages. */ + client_send_identify(flags); + diff -Nru tmux-2.0/debian/patches/upstream-f60d88cd24.diff tmux-2.0/debian/patches/upstream-f60d88cd24.diff --- tmux-2.0/debian/patches/upstream-f60d88cd24.diff 1970-01-01 00:00:00.000000000 +0000 +++ tmux-2.0/debian/patches/upstream-f60d88cd24.diff 2015-05-23 10:33:21.000000000 +0000 @@ -0,0 +1,149 @@ +From f60d88cd24cad4b126f641eccfd00a8dfc055113 Mon Sep 17 00:00:00 2001 +From: nicm +Date: Wed, 29 Apr 2015 15:59:08 +0000 +Subject: 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(-) + +--- a/options-table.c ++++ b/options-table.c +@@ -63,6 +63,11 @@ + .default_num = 20 + }, + ++ { .name = "default-terminal", ++ .type = OPTIONS_TABLE_STRING, ++ .default_str = "screen" ++ }, ++ + { .name = "escape-time", + .type = OPTIONS_TABLE_NUMBER, + .minimum = 0, +@@ -145,11 +150,6 @@ + .default_str = _PATH_BSHELL + }, + +- { .name = "default-terminal", +- .type = OPTIONS_TABLE_STRING, +- .default_str = "screen" +- }, +- + { .name = "destroy-unattached", + .type = OPTIONS_TABLE_FLAG, + .default_num = 0 +--- a/server-fn.c ++++ b/server-fn.c +@@ -36,7 +36,7 @@ + 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; +--- a/tmux.1 ++++ b/tmux.1 +@@ -2142,6 +2142,19 @@ + 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 +@@ -2281,18 +2294,6 @@ + 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 +--- 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 *); +@@ -450,6 +451,21 @@ + } + + 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) || +@@ -1360,12 +1376,8 @@ + 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)