summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-12-28 10:34:35 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-12-28 10:34:35 +0000
commited8c983a8c1a3dfecc40a0cd1d0ee65d29548c47 (patch)
tree700fc9ef095dd36d5c862bbfc37d56e4ca61a9e1 /usr.bin
parentd4b7b7a00e4c1d8b25d0c9650c4431e8d749bfd3 (diff)
Fix the prefer unattached session behaviour of
attach-session/switch-client, reported by Thomas Sattle.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd.c5
-rw-r--r--usr.bin/tmux/tmux.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index fd54bcbfd98..3c6df33e091 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.128 2016/11/02 13:35:36 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.129 2016/12/28 10:34:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -410,7 +410,7 @@ cmd_prepare_state_flag(char c, const char *target, enum cmd_entry_flag flag,
if (target != NULL && target[strcspn(target, ":.")] != '\0')
flag = CMD_PANE;
else
- flag = CMD_SESSION;
+ flag = CMD_SESSION_PREFERUNATTACHED;
}
targetflags = 0;
@@ -418,6 +418,7 @@ cmd_prepare_state_flag(char c, const char *target, enum cmd_entry_flag flag,
case CMD_SESSION:
case CMD_SESSION_CANFAIL:
case CMD_SESSION_PREFERUNATTACHED:
+ case CMD_SESSION_WITHPANE:
if (flag == CMD_SESSION_CANFAIL)
targetflags |= CMD_FIND_QUIET;
if (flag == CMD_SESSION_PREFERUNATTACHED)
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 3fb072b3d9c..50462d879be 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.681 2016/11/24 18:45:45 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.682 2016/12/28 10:34:34 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1305,7 +1305,7 @@ enum cmd_entry_flag {
CMD_SESSION,
CMD_SESSION_CANFAIL,
CMD_SESSION_PREFERUNATTACHED,
- CMD_SESSION_WITHPANE,
+ CMD_SESSION_WITHPANE, /* implies PREFERUNATTACHED */
CMD_WINDOW,
CMD_WINDOW_CANFAIL,