-/* $OpenBSD: options-table.c,v 1.147 2021/08/04 08:07:19 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.148 2021/08/06 09:19:02 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
OPTIONS_TABLE_HOOK("client-active", ""),
OPTIONS_TABLE_HOOK("client-attached", ""),
OPTIONS_TABLE_HOOK("client-detached", ""),
+ OPTIONS_TABLE_HOOK("client-focus-in", ""),
+ OPTIONS_TABLE_HOOK("client-focus-out", ""),
OPTIONS_TABLE_HOOK("client-resized", ""),
OPTIONS_TABLE_HOOK("client-session-changed", ""),
OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
-.\" $OpenBSD: tmux.1,v 1.845 2021/08/04 08:07:19 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.846 2021/08/06 09:19:02 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 4 2021 $
+.Dd $Mdocdate: August 6 2021 $
.Dt TMUX 1
.Os
.Sh NAME
Run when a client is attached.
.It client-detached
Run when a client is detached
+.It client-focus-in
+Run when focus enters a client
+.It client-focus-out
+Run when focus exits a client
.It client-resized
Run when a client is resized.
.It client-session-changed
-/* $OpenBSD: tty-keys.c,v 1.147 2021/06/10 07:21:10 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.148 2021/08/06 09:19:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
tty->flags &= ~TTY_TIMER;
/* Check for focus events. */
- if (key == KEYC_FOCUS_OUT)
+ if (key == KEYC_FOCUS_OUT) {
tty->client->flags &= ~CLIENT_FOCUSED;
- else if (key == KEYC_FOCUS_IN)
+ notify_client("client-focus-out", c);
+ } else if (key == KEYC_FOCUS_IN) {
tty->client->flags |= CLIENT_FOCUSED;
+ notify_client("client-focus-in", c);
+ }
/* Fire the key. */
if (key != KEYC_UNKNOWN) {