summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arguments.c4
-rw-r--r--cmd-command-prompt.c1
-rw-r--r--cmd-confirm-before.c4
-rw-r--r--cmd-queue.c8
-rw-r--r--compat.h5
-rw-r--r--compat/htonll.c1
-rw-r--r--compat/ntohll.c1
-rw-r--r--compat/setproctitle.c1
-rw-r--r--input.c4
-rw-r--r--layout-custom.c2
-rw-r--r--options-table.c8
-rw-r--r--server-client.c7
-rw-r--r--tmux.16
-rw-r--r--tmux.h2
-rw-r--r--window-copy.c2
-rw-r--r--window.c2
16 files changed, 47 insertions, 11 deletions
diff --git a/arguments.c b/arguments.c
index 669375e2..bf95b453 100644
--- a/arguments.c
+++ b/arguments.c
@@ -171,6 +171,8 @@ args_parse_flag_argument(struct args_value *values, u_int count, char **cause,
if (optional_argument) {
log_debug("%s: -%c (optional)", __func__, flag);
args_set(args, flag, NULL, ARGS_ENTRY_OPTIONAL_VALUE);
+ args_free_value(new);
+ free(new);
return (0); /* either - or end */
}
xasprintf(cause, "-%c expects an argument", flag);
@@ -662,6 +664,8 @@ args_set(struct args *args, u_char flag, struct args_value *value, int flags)
entry->count++;
if (value != NULL && value->type != ARGS_NONE)
TAILQ_INSERT_TAIL(&entry->values, value, entry);
+ else
+ free(value);
}
/* Get argument value. Will be NULL if it isn't present. */
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index 6010d0fd..60f7ca37 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -143,6 +143,7 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
cdata->prompt_type = status_prompt_type(type);
if (cdata->prompt_type == PROMPT_TYPE_INVALID) {
cmdq_error(item, "unknown type: %s", type);
+ cmd_command_prompt_free(cdata);
return (CMD_RETURN_ERROR);
}
} else
diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c
index 485e6e65..e9841d2d 100644
--- a/cmd-confirm-before.c
+++ b/cmd-confirm-before.c
@@ -76,8 +76,10 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item)
cdata = xcalloc(1, sizeof *cdata);
cdata->cmdlist = args_make_commands_now(self, item, 0, 1);
- if (cdata->cmdlist == NULL)
+ if (cdata->cmdlist == NULL) {
+ free(cdata);
return (CMD_RETURN_ERROR);
+ }
if (wait)
cdata->item = item;
diff --git a/cmd-queue.c b/cmd-queue.c
index e188afcd..789af513 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -805,10 +805,10 @@ cmdq_running(struct client *c)
struct cmdq_list *queue = cmdq_get(c);
if (queue->item == NULL)
- return (NULL);
- if (queue->item->flags & CMDQ_WAITING)
- return (NULL);
- return (queue->item);
+ return (NULL);
+ if (queue->item->flags & CMDQ_WAITING)
+ return (NULL);
+ return (queue->item);
}
/* Print a guard line. */
diff --git a/compat.h b/compat.h
index 720cd909..f33dcf1a 100644
--- a/compat.h
+++ b/compat.h
@@ -289,6 +289,11 @@ void explicit_bzero(void *, size_t);
int getdtablecount(void);
#endif
+#ifndef HAVE_GETDTABLESIZE
+/* getdtablesize.c */
+int getdtablesize(void);
+#endif
+
#ifndef HAVE_CLOSEFROM
/* closefrom.c */
void closefrom(int);
diff --git a/compat/htonll.c b/compat/htonll.c
index aef65983..86f34b46 100644
--- a/compat/htonll.c
+++ b/compat/htonll.c
@@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <arpa/inet.h>
#include <sys/types.h>
#include "compat.h"
diff --git a/compat/ntohll.c b/compat/ntohll.c
index c2fe1bb7..b1f77ca7 100644
--- a/compat/ntohll.c
+++ b/compat/ntohll.c
@@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <arpa/inet.h>
#include <sys/types.h>
#include "compat.h"
diff --git a/compat/setproctitle.c b/compat/setproctitle.c
index e72ae274..99fad55c 100644
--- a/compat/setproctitle.c
+++ b/compat/setproctitle.c
@@ -17,6 +17,7 @@
#include <sys/types.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include "compat.h"
diff --git a/input.c b/input.c
index e6016121..d375ea2d 100644
--- a/input.c
+++ b/input.c
@@ -2372,7 +2372,9 @@ input_exit_osc(struct input_ctx *ictx)
switch (option) {
case 0:
case 2:
- if (screen_set_title(sctx->s, p) && wp != NULL) {
+ if (wp != NULL &&
+ options_get_number(wp->options, "allow-set-title") &&
+ screen_set_title(sctx->s, p)) {
notify_pane("pane-title-changed", wp);
server_redraw_window_borders(wp->window);
server_status_window(wp->window);
diff --git a/layout-custom.c b/layout-custom.c
index d7be5b18..2bfb6d89 100644
--- a/layout-custom.c
+++ b/layout-custom.c
@@ -230,7 +230,7 @@ layout_parse(struct window *w, const char *layout, char **cause)
/* Check the new layout. */
if (!layout_check(lc)) {
*cause = xstrdup("size mismatch after applying layout");
- return (-1);
+ goto fail;
}
/* Resize to the layout size. */
diff --git a/options-table.c b/options-table.c
index 15018226..782ce17e 100644
--- a/options-table.c
+++ b/options-table.c
@@ -875,6 +875,14 @@ const struct options_table_entry options_table[] = {
"to rename windows."
},
+ { .name = "allow-set-title",
+ .type = OPTIONS_TABLE_FLAG,
+ .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
+ .default_num = 1,
+ .text = "Whether applications are allowed to use the escape sequence "
+ "to set the pane title."
+ },
+
{ .name = "alternate-screen",
.type = OPTIONS_TABLE_FLAG,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
diff --git a/server-client.c b/server-client.c
index a7494503..449a9bcc 100644
--- a/server-client.c
+++ b/server-client.c
@@ -622,6 +622,8 @@ server_client_check_mouse(struct client *c, struct key_event *event)
} else if (MOUSE_RELEASE(m->b)) {
type = UP;
x = m->x, y = m->y, b = m->lb;
+ if (m->sgr_type == 'm')
+ b = m->sgr_b;
log_debug("up at %u,%u", x, y);
} else {
if (c->flags & CLIENT_DOUBLECLICK) {
@@ -642,7 +644,10 @@ server_client_check_mouse(struct client *c, struct key_event *event)
log_debug("triple-click at %u,%u", x, y);
goto have_event;
}
- } else {
+ }
+
+ /* DOWN is the only remaining event type. */
+ if (type == NOTYPE) {
type = DOWN;
x = m->x, y = m->y, b = m->b;
log_debug("down at %u,%u", x, y);
diff --git a/tmux.1 b/tmux.1
index fbb94644..b73efdd6 100644
--- a/tmux.1
+++ b/tmux.1
@@ -4752,6 +4752,12 @@ they will be allowed even if the pane is invisible.
Allow programs in the pane to change the window name using a terminal escape
sequence (\eek...\ee\e\e).
.Pp
+.It Xo Ic allow-set-title
+.Op Ic on | off
+.Xc
+Allow programs in the pane to change the title using the terminal escape
+sequences (\ee]2;...\ee\e\e or \ee]0;...\ee\e\e).
+.Pp
.It Xo Ic alternate-screen
.Op Ic on | off
.Xc
diff --git a/tmux.h b/tmux.h
index 7671cca0..a052b799 100644
--- a/tmux.h
+++ b/tmux.h
@@ -877,7 +877,7 @@ struct screen_sel;
struct screen_titles;
struct screen {
char *title;
- char *path;
+ char *path;
struct screen_titles *titles;
struct grid *grid; /* grid data */
diff --git a/window-copy.c b/window-copy.c
index 27d9782a..a1f18476 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -4694,7 +4694,7 @@ window_copy_get_selection(struct window_mode_entry *wme, size_t *len)
if (keys == MODEKEY_EMACS || lastex <= ey_last) {
if (~grid_get_line(data->backing->grid, ey)->flags &
GRID_LINE_WRAPPED || lastex != ey_last)
- off -= 1;
+ off -= 1;
}
*len = off;
return (buf);
diff --git a/window.c b/window.c
index 69a42ab7..7b0d9a4c 100644
--- a/window.c
+++ b/window.c
@@ -481,7 +481,7 @@ window_pane_update_focus(struct window_pane *wp)
struct client *c;
int focused = 0;
- if (wp != NULL) {
+ if (wp != NULL && (~wp->flags & PANE_EXITED)) {
if (wp != wp->window->active)
focused = 0;
else {