Commit Graph

68 Commits

Author SHA1 Message Date
Thomas Adam
be568ea3b2 Merge branch 'obsd-master' into master 2021-03-16 10:01:20 +00:00
nicm
8b800b41c9 Add client-detached notification in control mode, from Mohsin Kaleem. 2021-03-16 09:14:58 +00:00
Thomas Adam
40126ee96c Merge branch 'obsd-master' 2020-05-21 08:55:31 +01:00
nicm
31e3f2d530 Support code for control mode flow control: allow clients to have
separate offsets (used and acknowleged) into the pane buffers; turn off
reading from panes when no clients can accept the data; and add a -A
flag to refresh-client to let clients turn receiving a pane on and off.
2020-05-21 07:24:13 +00:00
Thomas Adam
6d9b3704f5 Merge branch 'obsd-master' 2020-04-14 08:01:33 +01:00
nicm
63ec791854 Provide an accessor for the running queue item and use it to not let
hooks recurse.
2020-04-14 06:00:52 +00:00
Thomas Adam
acc00cd13a Merge branch 'obsd-master' 2020-04-13 18:01:43 +01:00
nicm
3f86d6d460 When adding a list of commands to the queue, instead of automatically
creating a new state for each group of commands, require the caller to
create one and use it for all the commands in the list. This means the
current target works even with list with multiple groups (which can
happen if they are defined with newlines).
2020-04-13 15:55:51 +00:00
Thomas Adam
0a11f1607b Merge branch 'obsd-master' 2020-04-13 16:01:46 +01:00
nicm
9a65102bfc Rename cmdq_shared to cmdq_state which will better reflect what it is
(going to be) used for.
2020-04-13 14:04:25 +00:00
nicm
53d6b94e8a Move the NOHOOKS flag into the shared flags. 2020-04-13 13:32:09 +00:00
Thomas Adam
8f2b5d714a Merge branch 'obsd-master' 2020-04-13 14:01:45 +01:00
nicm
04cdd03525 Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).
2020-04-13 10:59:58 +00:00
Thomas Adam
b117c3b812 Merge branch 'obsd-master' 2020-04-13 10:30:00 +01:00
nicm
9cbe9675ea Change so that the appropriate hooks for windows and panes belong to
pane/window options rather than all being session options. This is
useful for example to create a pane that is automatically closed on some
condition. From Anindya Mukherjee.
2020-04-13 07:25:33 +00:00
Thomas Adam
745233d6a1 Merge branch 'obsd-master' 2019-12-19 10:01:26 +00:00
nicm
1764f66b7d When adding a list with multiple commands to the queue, the next item to
insert after needs to be the last one added, not the first. Reported by
Jason Kim in GitHub issue 2023.
2019-12-19 09:22:33 +00:00
Thomas Adam
d9767b8112 Merge branch 'obsd-master' 2019-05-07 13:02:27 +01:00
nicm
69440d19b7 Do not use evbuffer_add_buffer because it is destructive and doesn't
work in newer libevent.
2019-05-07 10:25:15 +00:00
Thomas Adam
5489796737 Merge branch 'obsd-master' 2019-04-27 20:09:07 +01:00
nicm
dfb7bb6830 Merge hooks into options and make each one an array option. This allows
multiple commands to be easily bound to one hook. set-hook and
show-hooks remain but they are now variants of set-option and
show-options. show-options now has a -H flag to show hooks (by default
they are not shown).
2019-04-26 11:38:51 +00:00
Thomas Adam
20154f391e Merge branch 'obsd-master' 2018-07-04 15:02:25 +01:00
nicm
cc743dc296 Add set-hook -R to run a hook immediately (useful to set multiple hooks
to the same thing).
2018-07-04 12:30:52 +00:00
Thomas Adam
54c5070767 Merge branch 'obsd-master' 2017-08-30 12:01:10 +01:00
nicm
17cf1b21c6 Pass flags into cmd_find_from_* to fix prefer-unattached, reported by
Thomas Sattler.
2017-08-30 10:33:57 +00:00
Thomas Adam
f3221941f2 Merge branch 'obsd-master' 2017-05-04 10:01:12 +01:00
nicm
d98d316903 Some new notifications, mainly for active pane and current window and
session:

    pane-mode-changed
    window-pane-changed
    client-session-changed
    session-window-changed

From Joshua Brot.
2017-05-04 07:16:43 +00:00
Thomas Adam
3a8e56b282 Merge branch 'obsd-master' 2017-04-28 22:01:18 +01:00
nicm
0f2f783584 Log what is happening with window and session reference counts much more
obviously.
2017-04-28 19:13:55 +00:00
Thomas Adam
fd13731049 Merge branch 'obsd-master' 2017-04-21 22:01:14 +01:00
nicm
efaf4c16cf Make the cmd_find_* functions more obvious when looking for a client,
rather than having it inside other functions. Should be no change to the
way targets are resolved just yet.
2017-04-21 20:26:34 +00:00
Thomas Adam
4612419c14 Merge branch 'obsd-master' 2017-04-21 16:01:18 +01:00
nicm
c799425069 More unnecessary arguments now winlink points back to session. 2017-04-21 14:09:44 +00:00
Thomas Adam
0d19d78fff Merge branch 'obsd-master' 2017-01-11 16:01:16 +00:00
nicm
458b6eb600 Some tidying and tweaks to options code. 2017-01-11 14:56:44 +00:00
Thomas Adam
d54e990c4f Merge branch 'obsd-master' 2016-10-17 00:01:11 +01:00
nicm
fe106842c8 Use notifys for alerts too. 2016-10-16 22:18:04 +00:00
nicm
41e633acf5 Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.
2016-10-16 22:06:40 +00:00
Thomas Adam
1a6e696b08 Merge branch 'obsd-master' 2016-10-16 22:01:14 +01:00
nicm
d15d54c2c8 Add hook_session and hook_window formats to get information on the
affected session or window when a hook fires. Enable session-created and
session-closed hooks now that that is available.
2016-10-16 19:55:52 +00:00
nicm
3f35b5299f Provide a way for hooks to tag formats onto the commands they fire so
that the user can get at additional information - now used for the
"hook" format, more to come.
2016-10-16 19:36:37 +00:00
nicm
026ad08b56 Notifys can go via the command queue instead of using their own queue. 2016-10-16 19:15:02 +00:00
nicm
b342bd0b46 Mass rename struct cmd_q to struct cmdq_item and related. 2016-10-16 19:04:05 +00:00
Thomas Adam
c67b702588 Merge branch 'obsd-master' 2016-10-16 20:01:10 +01:00
nicm
ddc4512d2e Rewrite command queue handling. Each client still has a command queue,
but there is also now a global command queue. Instead of command queues
being dispatched on demand from wherever the command happens to be
added, they are now all dispatched from the top level server
loop. Command queues may now also include callbacks as well as commands,
and items may be inserted after the current command as well as at the end.

This all makes command queues significantly more predictable and easier
to use, and avoids the complex multiple nested command queues used by
source-file, if-shell and friends.

A mass rename of struct cmdq to a better name (cmdq_item probably) is
coming.
2016-10-16 17:55:14 +00:00
Thomas Adam
623e54788e Merge branch 'obsd-master' 2016-10-15 02:01:12 +01:00
nicm
3f138dc40c Rename a function for consistency and some spacing nits. 2016-10-15 00:12:58 +00:00
nicm
63b2547a02 Fire hooks on the simple notifys (window-renamed and session-renamed),
the complicated ones get no hooks for now (more to come).
2016-10-15 00:09:30 +00:00
nicm
9b3ae84993 Drain notifys once at the end of the server loop instead of doing it
from the end of every command queue (which could be nested).
2016-10-15 00:01:01 +00:00
Thomas Adam
b9dc855016 Merge branch 'obsd-master'
Conflicts:
	format.c
	osdep-openbsd.c
2016-10-12 09:45:49 +01:00