summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-queue.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Ignore running command when checking for no-hooks flag if it is blocked.nicm2020-11-301-2/+6
| | | | GitHub issue 2483.
* Add a -d option to display-message to set delay, from theonekeyg atnicm2020-07-271-2/+2
| | | | gmail dot com in GitHub issue 2322.
* Instead of sending all data to control mode clients as fast as possible,nicm2020-06-011-4/+7
| | | | | | 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.
* Separate key flags and modifiers, log key flags, make the "xterm" flagnicm2020-05-161-2/+2
| | | | more explicit and fix M- keys with a leading escape.
* Add a client flag 'active-pane' which stores the active pane in thenicm2020-05-161-2/+2
| | | | | | | | | client and allows it to be changed independently from the real active pane stored in the window. This is can be used with session groups which allow an independent current window (although it would be nice to have a flag for this too and remove session groups). The client active pane is only really useful interactively, many things (hooks, window-style, zooming) still use the window active pane.
* Expand target from client and use it to expand the prompt.nicm2020-05-161-3/+2
|
* Support embedded styles in the display-message message, GitHub issuenicm2020-05-161-2/+2
| | | | 2206.
* Change message log to be per server rather than per client and includenicm2020-05-161-1/+26
| | | | every command that is run.
* Add formats for after hook command arguments.nicm2020-05-161-2/+39
|
* Fix a couple of memory leaks, one when creating a new pane and one whennicm2020-04-231-3/+7
| | | | adding formats onto the queue item.
* Provide an accessor for the running queue item and use it to not letnicm2020-04-141-11/+27
| | | | hooks recurse.
* Make client -c and -t handling common in cmd-queue.c and try to benicm2020-04-131-5/+34
| | | | | clearer about whether the client is the target client (must have a session) or not.
* When adding a list of commands to the queue, instead of automaticallynicm2020-04-131-64/+108
| | | | | | | 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).
* Move cmdq_state into cmd-queue.c.nicm2020-04-131-10/+40
|
* Rename cmdq_shared to cmdq_state which will better reflect what it isnicm2020-04-131-32/+32
| | | | (going to be) used for.
* Store a key event not a mouse event in the shared data.nicm2020-04-131-3/+6
|
* Move the NOHOOKS flag into the shared flags.nicm2020-04-131-7/+9
|
* Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm2020-04-131-6/+113
| | | | use more clearly defined and preparation for some future work).
* Make struct cmd local to cmd.c and move it out of tmux.h.nicm2020-04-131-14/+21
|
* Now that copy mode copies the pane content rather than keeping anicm2020-04-101-3/+5
| | | | | | | | | | reference to it, it isn't necessary that the pane in copy mode is the same as the one copying from. Add a -s flag to copy-mode to specify a different pane for the source content. This means it is possible to view two places in a pane's history at the same time in different panes, or copy from a pane's history into an editor or shell in the same pane. From Anindya Mukherjee.
* Stop logging the entire command queue every time we add something,nicm2020-04-031-9/+1
| | | | spotted by tb & sthen.
* Send errors to stdout in control mode so they don't get reordered withnicm2020-01-051-2/+5
| | | | other output, reported by George Nachman in GitHub issue 2048.
* When adding a list with multiple commands to the queue, the next item tonicm2019-12-191-8/+17
| | | | | insert after needs to be the last one added, not the first. Reported by Jason Kim in GitHub issue 2023.
* Use the message that has already been built rather than the va_list.nicm2019-12-171-2/+2
|
* Rewrite the code for reading and writing files. Now, if the client isnicm2019-12-121-21/+15
| | | | | | | | | 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.
* Set up format tree for %if, GitHub issue 1896.nicm2019-09-101-2/+1
|
* Add a cmdq_continue function rather than twiddling the flag directly.nicm2019-06-181-1/+8
|
* Fix warnings, from Ben Boeckel.nicm2019-05-311-2/+2
|
* The line number needs to be updated only after the \n is processed bynicm2019-05-291-9/+21
| | | | | the parser, so store a flag and update it next time around. Also each new line needs its own shared data.
* Client name can actually be NULL, so use address in that case.nicm2019-05-251-2/+5
|
* Use client name when logging command queue.nicm2019-05-251-3/+3
|
* Don't remove group items for group 0 (no group).nicm2019-05-231-1/+3
|
* Replace the split parser code (cfg.c and cmd-string.c) with a singlenicm2019-05-231-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Replace the various identical error callbacks with a single one in cmd-queue.c.nicm2019-05-201-1/+20
|
* Move the single command flag (CMD_CONTROL) into the shared flags.nicm2019-05-181-2/+3
|
* Insert after the right element on queue.nicm2019-05-031-1/+2
|
* Correct ordering when adding after an existing item.nicm2019-05-031-16/+10
|
* Merge hooks into options and make each one an array option. This allowsnicm2019-04-261-2/+56
| | | | | | | 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).
* Break new window and pane creation common code from various commands andnicm2019-04-171-2/+2
| | | | window.c into a separate file spawn.c.
* Allow multiple modes to be open in a pane. A stack of open modes is keptnicm2019-03-121-8/+8
| | | | | | and the previous restored when the top is exited. If a mode that is already on the stack is entered, the existing instance is moved to the top as the active mode rather than being opened new.
* Make the mode used to view command output (a variant of copy mode) usenicm2019-03-081-8/+11
| | | | | its own mode definition struct with a different init function rather than calling special setup functions.
* Tidy changing the mode into window_copy_init_for_output.nicm2019-03-071-7/+2
|
* Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm2017-08-301-2/+2
| | | | Thomas Sattler.
* Tweak some logging.nicm2017-06-161-1/+3
|
* Rewrite of choose mode, both to simplify and tidy the code and to addnicm2017-05-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some modern features. Now the common code is in mode-tree.c, which provides an API used by the three modes now separated into window-{buffer,client,tree}.c. Buffer mode shows buffers, client mode clients and tree mode a tree of sessions, windows and panes. Each mode has a common set of key bindings plus a few that are specific to the mode. Other changes are: - each mode has a preview pane: for buffers this is the buffer content (very useful), for others it is a preview of the pane; - items may be sorted in different ways ('O' key); - multiple items may be tagged and an operation applied to all of them (for example, to delete multiple buffers at once); - in tree mode a command may be run on the selected item (session, window, pane) or on tagged items (key ':'); - displayed items may be filtered in tree mode by using a format (this is used to implement find-window) (key 'f'); - the custom format (-F) for the display is no longer available; - shortcut keys change from 0-9, a-z, A-Z which was always a bit weird with keys used for other uses to 0-9, M-a to M-z. Now that the code is simpler, other improvements will come later. Primary key bindings for each mode are documented under the commands in the man page (choose-buffer, choose-client, choose-tree). Parts written by Thomas Adam.
* In order that people can use formats like #D in #() in the status linenicm2017-05-011-2/+2
| | | | | | | | | | | | | | and not have to wait for an update when they change pane, we allow commands to run more than once a second if the expanded form changes. Unfortunately this can mean them being run far too often (pretty much continually) when multiple clients exist, because some formats (including #D) will always differ between clients. To avoid this, give each client its own tree of jobs which means that the same command will be different instances for each client - similar to how we have the tag to separate commands for different panes. GitHub issue 889; test case reported by Paul Johnson.
* Get rid of the extra layer of flags and cmd_prepare() and just store thenicm2017-04-221-12/+32
| | | | | | CMD_FIND_* flags in the cmd_entry and call it for the command. Commands with special requirements call it themselves and update the target for hooks to use.
* Log error properly when no current state, and some other minor tweaks.nicm2017-04-211-4/+4
|
* Clear shared state if not filling it in.nicm2017-04-211-1/+4
|
* Make the cmd_find_* functions more obvious when looking for a client,nicm2017-04-211-5/+6
| | | | | rather than having it inside other functions. Should be no change to the way targets are resolved just yet.