Commit Graph

14 Commits (c7a121cfc0137c907b7bfb0c3fd1bdee395af8aa)

Author SHA1 Message Date
Nicholas Marriott a0172a6ae5 Mark control commands specially so the client can identify them, based
on a diff from George Nachman a while back.
2013-06-28 20:55:16 +01:00
Thomas Adam b58bca9a72 Merge branch 'obsd-master'
Conflicts:
	tmux.c
2013-04-13 17:05:49 +01:00
Nicholas Marriott 7ada64d5f8 Fix bug where end guard in control mode was not printed after session
destroyed, from George Nachman.
2013-04-10 12:15:36 +00:00
Thomas 399a15b9fc Merge branch 'obsd-master' 2013-03-26 16:59:37 +00:00
Nicholas Marriott 771d7db3a6 Fix compiler warnings, missing #include. From Thomas Adam. 2013-03-26 10:54:48 +00:00
Nicholas Marriott 0ef24f9912 Only send end guard if begin was sent, from George Nachman. 2013-03-25 11:41:16 +00:00
Nicholas Marriott ebd9c615c8 Add some additional debug logging. 2013-03-25 10:06:13 +00:00
Nicholas Marriott 20636d956d Add a command queue to standardize and simplify commands that call other
commands and allow a command to block execution of subsequent
commands. This allows run-shell and if-shell to be synchronous which has
been much requested.

Each client has a default command queue and commands are consumed one at
a time from it. A command may suspend execution from the queue by
returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() -
for example run-shell does this from the callback that is fired after
the job is freed.

When the command queue becomes empty, command clients are automatically
exited (unless attaching). A callback is also fired - this is used for
nested commands in, for example, if-shell which can block execution of
the client's cmdq until a new cmdq becomes empty.

Also merge all the old error/info/print functions together and lose the
old curclient/cmdclient distinction - a cmdq is bound to one client (or
none if in the configuration file), this is a command client if
c->session is NULL otherwise an attached client.
2013-03-24 09:54:10 +00:00
Nicholas Marriott c5ad47ee7c Only send end guard if begin was sent, from George Nachman. 2013-03-13 07:31:36 +00:00
Nicholas Marriott 49ed75d883 Fix a warning. 2013-03-11 09:37:16 +00:00
Nicholas Marriott c41d92d27a Add time and a command count to control mode guards, based on code from George
Nachman.
2013-03-11 09:35:44 +00:00
Nicholas Marriott f8c86a9515 Add some additional debug logging. 2013-03-05 17:17:59 +00:00
Nicholas Marriott 70397e4a95 Print %%error not %%end guard on error, from George Nachman. 2013-03-04 09:09:07 +00:00
Nicholas Marriott 3964309c67 Add a command queue to standardize and simplify commands that call other
commands and allow a command to block execution of subsequent commands. This
allows run-shell and if-shell to be synchronous which has been much requested.

Each client has a default command queue and commands are consumed one at a time
from it. A command may suspend execution from the queue by returning
CMD_RETURN_WAIT and then resume it by calling cmd_continue() - for example
run-shell does this from the callback that is fired after the job is freed.

When the command queue becomes empty, command clients are automatically exited
(unless attaching). A callback is also fired - this is used for nested commands
in, for example, if-shell which can block execution of the client's cmdq until
a new cmdq becomes empty.

Also merge all the old error/info/print functions together and lose the old
curclient/cmdclient distinction - a cmdq is bound to one client (or none if in
the configuration file), this is a command client if c->session is NULL
otherwise an attached client.
2013-02-23 22:25:58 +00:00