From 161cd4d2783d49053b348d38c58dabbcc85a1ee4 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 30 Aug 2017 10:33:58 +0000 Subject: Pass flags into cmd_find_from_* to fix prefer-unattached, reported by Thomas Sattler. --- usr.bin/tmux/cmd-attach-session.c | 6 ++-- usr.bin/tmux/cmd-break-pane.c | 4 +-- usr.bin/tmux/cmd-find.c | 60 +++++++++++++++++++-------------------- usr.bin/tmux/cmd-join-pane.c | 4 +-- usr.bin/tmux/cmd-new-session.c | 6 ++-- usr.bin/tmux/cmd-new-window.c | 6 ++-- usr.bin/tmux/cmd-queue.c | 4 +-- usr.bin/tmux/cmd-rotate-window.c | 6 ++-- usr.bin/tmux/cmd-run-shell.c | 4 +-- usr.bin/tmux/cmd-select-pane.c | 6 ++-- usr.bin/tmux/cmd-select-window.c | 8 +++--- usr.bin/tmux/cmd-split-window.c | 6 ++-- usr.bin/tmux/cmd-switch-client.c | 4 +-- usr.bin/tmux/notify.c | 18 ++++++------ usr.bin/tmux/server-client.c | 6 ++-- usr.bin/tmux/tmux.h | 22 +++++++------- usr.bin/tmux/window-tree.c | 4 +-- 17 files changed, 88 insertions(+), 86 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index 896c00bfaa4..c911205148f 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.73 2017/04/22 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.74 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -90,9 +90,9 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, window_set_active_pane(wp->window, wp); session_set_current(s, wl); if (wp != NULL) - cmd_find_from_winlink_pane(current, wl, wp); + cmd_find_from_winlink_pane(current, wl, wp, 0); else - cmd_find_from_winlink(current, wl); + cmd_find_from_winlink(current, wl, 0); } if (cflag != NULL) { diff --git a/usr.bin/tmux/cmd-break-pane.c b/usr.bin/tmux/cmd-break-pane.c index 83b83004b6f..dcf13c3431e 100644 --- a/usr.bin/tmux/cmd-break-pane.c +++ b/usr.bin/tmux/cmd-break-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-break-pane.c,v 1.45 2017/04/22 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-break-pane.c,v 1.46 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -97,7 +97,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) wl = session_attach(dst_s, w, idx, &cause); /* can't fail */ if (!args_has(self->args, 'd')) { session_select(dst_s, wl->idx); - cmd_find_from_session(current, dst_s); + cmd_find_from_session(current, dst_s, 0); } server_redraw_session(src_s); diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index e01ffc61d07..b34db99b621 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.56 2017/08/28 12:36:38 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.57 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -728,9 +728,9 @@ cmd_find_log_state(const char *prefix, struct cmd_find_state *fs) /* Find state from a session. */ void -cmd_find_from_session(struct cmd_find_state *fs, struct session *s) +cmd_find_from_session(struct cmd_find_state *fs, struct session *s, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = s; fs->wl = fs->s->curw; @@ -742,9 +742,9 @@ cmd_find_from_session(struct cmd_find_state *fs, struct session *s) /* Find state from a winlink. */ void -cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl) +cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = wl->session; fs->wl = wl; @@ -757,14 +757,14 @@ cmd_find_from_winlink(struct cmd_find_state *fs, struct winlink *wl) /* Find state from a session and window. */ int cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s, - struct window *w) + struct window *w, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = s; fs->w = w; if (cmd_find_best_winlink_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wp = fs->w->active; @@ -775,17 +775,17 @@ cmd_find_from_session_window(struct cmd_find_state *fs, struct session *s, /* Find state from a window. */ int -cmd_find_from_window(struct cmd_find_state *fs, struct window *w) +cmd_find_from_window(struct cmd_find_state *fs, struct window *w, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->w = w; if (cmd_find_best_session_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } if (cmd_find_best_winlink_with_window(fs) != 0) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wp = fs->w->active; @@ -797,9 +797,9 @@ cmd_find_from_window(struct cmd_find_state *fs, struct window *w) /* Find state from a winlink and pane. */ void cmd_find_from_winlink_pane(struct cmd_find_state *fs, struct winlink *wl, - struct window_pane *wp) + struct window_pane *wp, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); fs->s = wl->session; fs->wl = wl; @@ -812,9 +812,9 @@ cmd_find_from_winlink_pane(struct cmd_find_state *fs, struct winlink *wl, /* Find state from a pane. */ int -cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) +cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp, int flags) { - if (cmd_find_from_window(fs, wp->window) != 0) + if (cmd_find_from_window(fs, wp->window, flags) != 0) return (-1); fs->wp = wp; @@ -824,13 +824,13 @@ cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) /* Find state from nothing. */ int -cmd_find_from_nothing(struct cmd_find_state *fs) +cmd_find_from_nothing(struct cmd_find_state *fs, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); - fs->s = cmd_find_best_session(NULL, 0, fs->flags); + fs->s = cmd_find_best_session(NULL, 0, flags); if (fs->s == NULL) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->wl = fs->s->curw; @@ -844,16 +844,16 @@ cmd_find_from_nothing(struct cmd_find_state *fs) /* Find state from mouse. */ int -cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m) +cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m, int flags) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); if (!m->valid) return (-1); fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl); if (fs->wp == NULL) { - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); return (-1); } fs->w = fs->wl->window; @@ -864,7 +864,7 @@ cmd_find_from_mouse(struct cmd_find_state *fs, struct mouse_event *m) /* Find state from client. */ int -cmd_find_from_client(struct cmd_find_state *fs, struct client *c) +cmd_find_from_client(struct cmd_find_state *fs, struct client *c, int flags) { struct session *s; struct winlink *wl; @@ -872,14 +872,14 @@ cmd_find_from_client(struct cmd_find_state *fs, struct client *c) /* If no client, treat as from nothing. */ if (c == NULL) - return (cmd_find_from_nothing(fs)); + return (cmd_find_from_nothing(fs, flags)); /* If this is an attached client, all done. */ if (c->session != NULL) { - cmd_find_from_session(fs, c->session); + cmd_find_from_session(fs, c->session, flags); return (0); } - cmd_find_clear_state(fs, 0); + cmd_find_clear_state(fs, flags); /* * If this is an unattached client running in a pane, we can use that @@ -938,12 +938,12 @@ unknown_pane: */ s = cmd_find_try_TMUX(c); if (s != NULL) { - cmd_find_from_session(fs, s); + cmd_find_from_session(fs, s, flags); return (0); } /* Otherwise we need to guess. */ - return (cmd_find_from_nothing(fs)); + return (cmd_find_from_nothing(fs, flags)); } /* @@ -989,7 +989,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, } else if (cmd_find_valid_state(&item->shared->current)) { fs->current = &item->shared->current; log_debug("%s: current is from queue", __func__); - } else if (cmd_find_from_client(¤t, item->client) == 0) { + } else if (cmd_find_from_client(¤t, item->client, flags) == 0) { fs->current = ¤t; log_debug("%s: current is from client", __func__); } else { diff --git a/usr.bin/tmux/cmd-join-pane.c b/usr.bin/tmux/cmd-join-pane.c index af8c846cbaa..aae9919f9ea 100644 --- a/usr.bin/tmux/cmd-join-pane.c +++ b/usr.bin/tmux/cmd-join-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-join-pane.c,v 1.32 2017/04/22 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-join-pane.c,v 1.33 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman @@ -147,7 +147,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item) if (!args_has(args, 'd')) { window_set_active_pane(dst_w, src_wp); session_select(dst_s, dst_idx); - cmd_find_from_session(current, dst_s); + cmd_find_from_session(current, dst_s, 0); server_redraw_session(dst_s); } else server_status_session(dst_s); diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index 41c8553c0c3..91cfbe5ca3c 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.108 2017/07/21 09:17:19 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.109 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -325,10 +325,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) if (!detached) { c->flags |= CLIENT_ATTACHED; - cmd_find_from_session(&item->shared->current, s); + cmd_find_from_session(&item->shared->current, s, 0); } - cmd_find_from_session(&fs, s); + cmd_find_from_session(&fs, s, 0); hooks_insert(s->hooks, item, &fs, "after-new-session"); free(to_free); diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c index 9261599d679..863fb103ccd 100644 --- a/usr.bin/tmux/cmd-new-window.c +++ b/usr.bin/tmux/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.71 2017/07/21 09:17:19 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.72 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -133,7 +133,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) } if (!detached) { session_select(s, wl->idx); - cmd_find_from_winlink(current, wl); + cmd_find_from_winlink(current, wl, 0); server_redraw_session_group(s); } else server_status_session_group(s); @@ -146,7 +146,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) free(cp); } - cmd_find_from_winlink(&fs, wl); + cmd_find_from_winlink(&fs, wl, 0); hooks_insert(s->hooks, item, &fs, "after-new-window"); free(to_free); diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index 8770c516914..a5896acab47 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.57 2017/06/16 15:12:38 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.58 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott @@ -241,7 +241,7 @@ cmdq_fire_command(struct cmdq_item *item) fsp = &item->target; else if (cmd_find_valid_state(&item->shared->current)) fsp = &item->shared->current; - else if (cmd_find_from_client(&fs, item->client) == 0) + else if (cmd_find_from_client(&fs, item->client, 0) == 0) fsp = &fs; else goto out; diff --git a/usr.bin/tmux/cmd-rotate-window.c b/usr.bin/tmux/cmd-rotate-window.c index aae2dc35786..6a35cf29408 100644 --- a/usr.bin/tmux/cmd-rotate-window.c +++ b/usr.bin/tmux/cmd-rotate-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rotate-window.c,v 1.24 2017/05/09 11:00:48 nicm Exp $ */ +/* $OpenBSD: cmd-rotate-window.c,v 1.25 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -78,7 +78,7 @@ cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item) if ((wp = TAILQ_PREV(w->active, window_panes, entry)) == NULL) wp = TAILQ_LAST(&w->panes, window_panes); window_set_active_pane(w, wp); - cmd_find_from_winlink_pane(current, wl, wp); + cmd_find_from_winlink_pane(current, wl, wp, 0); server_redraw_window(w); } else { wp = TAILQ_FIRST(&w->panes); @@ -106,7 +106,7 @@ cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item) if ((wp = TAILQ_NEXT(w->active, entry)) == NULL) wp = TAILQ_FIRST(&w->panes); window_set_active_pane(w, wp); - cmd_find_from_winlink_pane(current, wl, wp); + cmd_find_from_winlink_pane(current, wl, wp, 0); server_redraw_window(w); } diff --git a/usr.bin/tmux/cmd-run-shell.c b/usr.bin/tmux/cmd-run-shell.c index 18cd0db6dd5..bb80e2c95db 100644 --- a/usr.bin/tmux/cmd-run-shell.c +++ b/usr.bin/tmux/cmd-run-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-run-shell.c,v 1.50 2017/05/30 21:44:59 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.51 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -68,7 +68,7 @@ cmd_run_shell_print(struct job *job, const char *msg) cmdq_print(cdata->item, "%s", msg); return; } - if (cmd_find_from_nothing(&fs) != 0) + if (cmd_find_from_nothing(&fs, 0) != 0) return; wp = fs.wp; if (wp == NULL) diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c index 7d502fc1034..9e76625bf0c 100644 --- a/usr.bin/tmux/cmd-select-pane.c +++ b/usr.bin/tmux/cmd-select-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.39 2017/08/08 09:21:20 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.40 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -77,7 +77,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) server_unzoom_window(w); window_redraw_active_switch(w, lastwp); if (window_set_active_pane(w, lastwp)) { - cmd_find_from_winlink(current, wl); + cmd_find_from_winlink(current, wl, 0); server_status_window(w); server_redraw_window_borders(w); } @@ -156,7 +156,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) } window_redraw_active_switch(w, wp); if (window_set_active_pane(w, wp)) { - cmd_find_from_winlink_pane(current, wl, wp); + cmd_find_from_winlink_pane(current, wl, wp, 0); hooks_insert(s->hooks, item, current, "after-select-pane"); server_status_window(w); server_redraw_window_borders(w); diff --git a/usr.bin/tmux/cmd-select-window.c b/usr.bin/tmux/cmd-select-window.c index 6e274564cba..2e08f3abd54 100644 --- a/usr.bin/tmux/cmd-select-window.c +++ b/usr.bin/tmux/cmd-select-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-window.c,v 1.21 2017/08/08 09:21:20 nicm Exp $ */ +/* $OpenBSD: cmd-select-window.c,v 1.22 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -117,7 +117,7 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_ERROR); } } - cmd_find_from_session(current, s); + cmd_find_from_session(current, s, 0); server_redraw_session(s); hooks_insert(s->hooks, item, current, "after-select-window"); } else { @@ -131,10 +131,10 @@ cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) return (-1); } if (current->s == s) - cmd_find_from_session(current, s); + cmd_find_from_session(current, s, 0); server_redraw_session(s); } else if (session_select(s, wl->idx) == 0) { - cmd_find_from_session(current, s); + cmd_find_from_session(current, s, 0); server_redraw_session(s); } hooks_insert(s->hooks, item, current, "after-select-window"); diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c index 02f0f6766dd..ac39f5ce356 100644 --- a/usr.bin/tmux/cmd-split-window.c +++ b/usr.bin/tmux/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-split-window.c,v 1.86 2017/07/21 09:17:19 nicm Exp $ */ +/* $OpenBSD: cmd-split-window.c,v 1.87 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -158,7 +158,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) if (!args_has(args, 'd')) { window_set_active_pane(w, new_wp); session_select(s, wl->idx); - cmd_find_from_session(current, s); + cmd_find_from_session(current, s, 0); server_redraw_session(s); } else server_status_session(s); @@ -172,7 +172,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) } notify_window("window-layout-changed", w); - cmd_find_from_winlink_pane(&fs, wl, new_wp); + cmd_find_from_winlink_pane(&fs, wl, new_wp, 0); hooks_insert(s->hooks, item, &fs, "after-split-window"); free(to_free); diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c index 1179ceff87e..9b1807b3f58 100644 --- a/usr.bin/tmux/cmd-switch-client.c +++ b/usr.bin/tmux/cmd-switch-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-switch-client.c,v 1.52 2017/05/04 07:16:43 nicm Exp $ */ +/* $OpenBSD: cmd-switch-client.c,v 1.53 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -116,7 +116,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item) if (wp != NULL) window_set_active_pane(wp->window, wp); session_set_current(s, wl); - cmd_find_from_session(&item->shared->current, s); + cmd_find_from_session(&item->shared->current, s, 0); } } diff --git a/usr.bin/tmux/notify.c b/usr.bin/tmux/notify.c index deba323a2ec..87f372c3732 100644 --- a/usr.bin/tmux/notify.c +++ b/usr.bin/tmux/notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notify.c,v 1.24 2017/05/04 07:16:43 nicm Exp $ */ +/* $OpenBSD: notify.c,v 1.25 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2012 George Nachman @@ -46,7 +46,7 @@ notify_hook(struct cmdq_item *item, struct notify_entry *ne) cmd_find_clear_state(&fs, 0); if (cmd_find_empty_state(&ne->fs) || !cmd_find_valid_state(&ne->fs)) - cmd_find_from_nothing(&fs); + cmd_find_from_nothing(&fs, 0); else cmd_find_copy_state(&fs, &ne->fs); @@ -170,7 +170,7 @@ notify_client(const char *name, struct client *c) { struct cmd_find_state fs; - cmd_find_from_client(&fs, c); + cmd_find_from_client(&fs, c, 0); notify_add(name, &fs, c, NULL, NULL, NULL); } @@ -180,9 +180,9 @@ notify_session(const char *name, struct session *s) struct cmd_find_state fs; if (session_alive(s)) - cmd_find_from_session(&fs, s); + cmd_find_from_session(&fs, s, 0); else - cmd_find_from_nothing(&fs); + cmd_find_from_nothing(&fs, 0); notify_add(name, &fs, NULL, s, NULL, NULL); } @@ -191,7 +191,7 @@ notify_winlink(const char *name, struct winlink *wl) { struct cmd_find_state fs; - cmd_find_from_winlink(&fs, wl); + cmd_find_from_winlink(&fs, wl, 0); notify_add(name, &fs, NULL, wl->session, wl->window, NULL); } @@ -200,7 +200,7 @@ notify_session_window(const char *name, struct session *s, struct window *w) { struct cmd_find_state fs; - cmd_find_from_session_window(&fs, s, w); + cmd_find_from_session_window(&fs, s, w, 0); notify_add(name, &fs, NULL, s, w, NULL); } @@ -209,7 +209,7 @@ notify_window(const char *name, struct window *w) { struct cmd_find_state fs; - cmd_find_from_window(&fs, w); + cmd_find_from_window(&fs, w, 0); notify_add(name, &fs, NULL, NULL, w, NULL); } @@ -218,6 +218,6 @@ notify_pane(const char *name, struct window_pane *wp) { struct cmd_find_state fs; - cmd_find_from_pane(&fs, wp); + cmd_find_from_pane(&fs, wp, 0); notify_add(name, &fs, NULL, NULL, NULL, wp); } diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 10ce7534c83..a73f5bf3ceb 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.242 2017/08/16 12:12:54 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.243 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -877,8 +877,8 @@ server_client_handle_key(struct client *c, key_code key) m->valid = 0; /* Find affected pane. */ - if (!KEYC_IS_MOUSE(key) || cmd_find_from_mouse(&fs, m) != 0) - cmd_find_from_session(&fs, s); + if (!KEYC_IS_MOUSE(key) || cmd_find_from_mouse(&fs, m, 0) != 0) + cmd_find_from_session(&fs, s, 0); wp = fs.wp; /* Forward mouse keys if disabled. */ diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 03a55aa811e..e07db1d5b05 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.802 2017/08/28 12:36:38 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.803 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1768,20 +1768,22 @@ void cmd_find_copy_state(struct cmd_find_state *, struct cmd_find_state *); void cmd_find_log_state(const char *, struct cmd_find_state *); void cmd_find_from_session(struct cmd_find_state *, - struct session *); + struct session *, int); void cmd_find_from_winlink(struct cmd_find_state *, - struct winlink *); + struct winlink *, int); int cmd_find_from_session_window(struct cmd_find_state *, - struct session *, struct window *); -int cmd_find_from_window(struct cmd_find_state *, struct window *); + struct session *, struct window *, int); +int cmd_find_from_window(struct cmd_find_state *, struct window *, + int); void cmd_find_from_winlink_pane(struct cmd_find_state *, - struct winlink *, struct window_pane *); + struct winlink *, struct window_pane *, int); int cmd_find_from_pane(struct cmd_find_state *, - struct window_pane *); -int cmd_find_from_client(struct cmd_find_state *, struct client *); + struct window_pane *, int); +int cmd_find_from_client(struct cmd_find_state *, struct client *, + int); int cmd_find_from_mouse(struct cmd_find_state *, - struct mouse_event *); -int cmd_find_from_nothing(struct cmd_find_state *); + struct mouse_event *, int); +int cmd_find_from_nothing(struct cmd_find_state *, int); /* cmd.c */ int cmd_pack_argv(int, char **, char *, size_t); diff --git a/usr.bin/tmux/window-tree.c b/usr.bin/tmux/window-tree.c index b4004535c6d..03928724683 100644 --- a/usr.bin/tmux/window-tree.c +++ b/usr.bin/tmux/window-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-tree.c,v 1.16 2017/08/09 13:44:36 nicm Exp $ */ +/* $OpenBSD: window-tree.c,v 1.17 2017/08/30 10:33:57 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott @@ -874,7 +874,7 @@ window_tree_get_target(struct window_tree_itemdata *item, if (target == NULL) cmd_find_clear_state(fs, 0); else - cmd_find_from_winlink_pane(fs, wl, wp); + cmd_find_from_winlink_pane(fs, wl, wp, 0); return (target); } -- cgit v1.2.3