summaryrefslogtreecommitdiffstats
path: root/control.c
AgeCommit message (Collapse)Author
2022-08-24Merge branch 'obsd-master'Thomas Adam
2022-08-24Check for NULL returns from bufferevent_new.nicm
2022-07-06Merge branch 'obsd-master'Thomas Adam
2022-07-06Defer reading from control client until the command line command hasnicm
completed.
2021-08-25Merge branch 'obsd-master' into masterThomas Adam
2021-08-25Fix up some printflike attributes.nicm
2021-08-17Merge branch 'obsd-master' into masterThomas Adam
2021-08-17Treat a pane that has died the same as no pane when sending data tonicm
control mode clients, GitHub issue 2828.
2021-01-17Look for libevent2 differently from libevent for platforms with both.Nicholas Marriott
2020-09-18Some other warnings, GitHub issue 2382.nicm
2020-07-06Add a way for control mode clients to subscribe to a format and benicm
notified of changes rather than having to poll. GitHub issue 2242.
2020-06-18Add a flag to make a client wait for an empty line before exiting innicm
control mode to avoid stray commands ending up in the shell.
2020-06-12Check if a pane needs to be paused when output is written rather thannicm
just when it is queued.
2020-06-11Add a -A option to pause a pane manually.nicm
2020-06-10Instead of a buffer size limit on each pane, set a limit of 300 secondsnicm
of data for each client in control mode.
2020-06-10When the pause-after flag is set, send an alternative %extended-outputnicm
form instead of %output with the age of the output.
2020-06-05Add support for pausing a pane when the output buffered for a controlnicm
mode client gets too far behind. The pause-after flag with a time is set on the pane with refresh-client -f and a paused pane may be resumed with refresh-client -A. GitHub issue 2217.
2020-06-02Use CLOCK_MONOTONIC for timer measurement and add a timestamp to controlnicm
mode %output blocks.
2020-06-01Remove blocks from queue when pane disappears.nicm
2020-06-01Instead of sending all data to control mode clients as fast as possible,nicm
add a limit of how much data will be sent to the client and try to use it for panes with some degree of fairness. GitHub issue 2217, with George Nachman.
2020-05-26Pass the stdout file descriptor from the client as well as stdin and usenicm
them for control clients directly instead of passing everything via the client.
2020-05-24Give control code its own state struct.nicm
2020-05-22Move client offset stuff into control.c since only control clients willnicm
need it.
2020-05-21Support code for control mode flow control: allow clients to havenicm
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-04-13Add helpers for the simple case of parse string and add to command queue.nicm
2020-04-13When adding a list of commands to the queue, instead of automaticallynicm
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-13Move cmdq_state into cmd-queue.c.nicm
2020-04-13Rename cmdq_shared to cmdq_state which will better reflect what it isnicm
(going to be) used for.
2020-04-13Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm
use more clearly defined and preparation for some future work).
2019-12-12Rewrite the code for reading and writing files. Now, if the client isnicm
not attached, the server process asks it to open the file, similar to how works for stdin, stdout, stderr. This makes special files like /dev/fd/X work (used by some shells). stdin, stdout and stderr and control mode are now just special cases of the same mechanism. This will also make it easier to use for other commands that read files such as source-file.
2019-07-09Do not leak empty lines, GitHub issue 1824.nicm
2019-05-31Allow % strings that are all numbers or %s, and fix a double free. Bothnicm
reported by George Nachman, GitHub issues 1765 and 1766.
2019-05-23Replace the split parser code (cfg.c and cmd-string.c) with a singlenicm
parser using yacc(1). This is a major change but is clearer and simpler and allows some edge cases to be made more consistent, as well as tidying up how aliases are handled. It will also allow some further improvements later. Entirely the same parser is now used for parsing the configuration file and for string commands. This means that constructs previously only available in .tmux.conf, such as %if, can now be used in string commands (for example, those given to if-shell - not commands invoked from the shell, they are still parsed by the shell itself). The only syntax change I am aware of is that #{} outside quotes or a comment is now considered a format and not a comment, so #{ is now a syntax error (notably, if it is at the start of a line). This also adds two new sections to the man page documenting the syntax and outlining how parsing and command execution works. Thanks to everyone who sent me test configs (they still all parse without errors - but this doesn't mean they still work as intended!). Thanks to Avi Halachmi for testing and man page improvements, also to jmc@ for reviewing the man page changes.
2019-05-18Move the single command flag (CMD_CONTROL) into the shared flags.nicm
2017-01-15It is silly for cmd_list_parse to return an integer error when it couldnicm
just return NULL.
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-16Rewrite command queue handling. Each client still has a command queue,nicm
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-01-19I no longer use my SourceForge address so replace it.nicm
2015-11-18Use __unused rather than rolling our own.nicm
2015-11-14Push stdout and stderr to clients more aggressively, and add an event tonicm
continue if the send fails.
2015-04-19Rewrite of tmux mouse support which was a mess. Instead of havingnicm
options for "mouse-this" and "mouse-that", mouse events may be bound as keys and there is one option "mouse" that turns on mouse support entirely (set -g mouse on). See the new MOUSE SUPPORT section of the man page for description of the key names and new flags (-t= to specify the pane or window under mouse as a target, and send-keys -M to pass through a mouse event). The default builtin bindings for the mouse are: bind -n MouseDown1Pane select-pane -t=; send-keys -M bind -n MouseDown1Status select-window -t= bind -n MouseDrag1Pane copy-mode -M bind -n MouseDrag1Border resize-pane -M To get the effect of turning mode-mouse off, do: unbind -n MouseDrag1Pane unbind -temacs-copy MouseDrag1Pane The old mouse options are now gone, set-option -q may be used to suppress warnings if mixing configuration files.
2014-10-20Better format for printf format attributes.nicm
2013-10-10Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd cannicm
be NULL. Avoids crash when a command in a command client can't be parsed.
2013-06-23Mark control commands specially so the client can identify them, basedNicholas Marriott
on a diff from George Nachman a while back.
2013-03-26Fix compiler warnings, missing #include. From Thomas Adam.Nicholas Marriott
2013-03-25Add time and a command count to control mode guards, based on code fromNicholas Marriott
George Nachman.
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
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-22Need to set clients in context before changing their reference count.Nicholas Marriott
2013-03-22Remove unnecessary initializers of cmd_ctx.Nicholas Marriott
2012-09-24Add control_write_buffer, from George Nachman.Nicholas Marriott