summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-queue.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Style nits and an unused struct.nicm2017-04-211-4/+3
|
* Store state shared between multiple commands in the queue in a sharednicm2017-04-211-13/+19
| | | | structure.
* Add a window or pane id "tag" to each format tree and use it to separatenicm2017-02-031-2/+2
| | | | | | jobs, this means that if the same job is used for different windows or panes (for example in pane-border-format), it will be run separately for each pane.
* Highlight all occurrences of search string after searching in copy mode.nicm2017-01-051-2/+1
|
* Give each item on queue a name for better logging.nicm2016-10-181-4/+16
|
* Provide a way for hooks to tag formats onto the commands they fire sonicm2016-10-161-2/+25
| | | | | that the user can get at additional information - now used for the "hook" format, more to come.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-161-106/+106
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-161-197/+294
| | | | | | | | | | | | | | | 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.
* Drain notifys once at the end of the server loop instead of doing itnicm2016-10-151-6/+2
| | | | from the end of every command queue (which could be nested).
* source-file and some other commands can recurse back into cmdq_continue,nicm2016-10-141-3/+10
| | | | | | | which could potentially free the currently running command, so we need to take a reference to it in cmdq_continue_one. Fixes problem reported by Theo Buehler.
* Trying to do hooks generically is way too complicated and unreliable andnicm2016-10-131-63/+27
| | | | | | | | | | | | | | | | | | confusing, particularly trying to automatically figure out what target hooks should be using. So simplify it: - drop before hooks entirely, they don't seem to be very useful; - commands with special requirements now fire their own after hook (for example, if they change session or window, or if they have -t and -s and need to choose which one the hook uses as current target); - commands with no special requirements can have the CMD_AFTERHOOK flag added and they will use the -t state. At the moment new-session, new-window, split-window fire their own hook, and display-message uses the flag. The remaining commands still need to be looked at.
* Some improvements and bug fixes for hooks:nicm2016-10-131-17/+29
| | | | | | | | | | | | | | | | | | | | | - Prepare the state again before the "after" hooks are run, because the command may have killed or moved windows. - Use the hooks list from the newly prepared target, not the old hooks list (only matters for new-session really). - Correctly detect an invalid current state and ignore it in cmd_find_target ("killw; swapw"). - Change neww, new, killp, killw, splitw, swapp, swapw to update the current state (used if no explicit target is given) to something more useful after they have finished. For example, neww changes it to the newly created window. Hooks are still relatively new and primitive so there are likely to be more changes to come. Parts based on bug reports from Uwe Werler and Iblis Lin.
* Add static in window-*.c and move some internal functions out of tmux.h.nicm2016-10-111-2/+3
|
* Couple of vasprintf -> xvasprintf.nicm2016-09-281-2/+2
|
* Final parts of command hooks, add before- and after- hooks to each command.nicm2016-04-291-8/+50
|
* Split out getting the current state from the target search so it can benicm2016-01-191-2/+2
| | | | replaced if we already know the current.
* I no longer use my SourceForge address so replace it.nicm2016-01-191-2/+2
|
* Add infrastructure to work out the best target given a pane or windownicm2015-12-161-1/+5
| | | | alone and use it to add pane_died and pane_exited hooks.
* If command returns error, report it.nicm2015-12-131-1/+3
|
* Instead of every command resolving the target (-t or -s) itself, preparenicm2015-12-131-12/+15
| | | | | | | | | | | | | | | | the state (client, session, winlink, pane) for it it before entering the command. Each command provides some flags that tell the prepare step what it is expecting. This is a requirement for having hooks on commands (for example, if you hook "select-window -t1:2", the hook command should to operate on window 1:2 not whatever it thinks is the current window), and should allow some other target improvements. The old cmd_find_* functions remain for the moment but that layer will be dropped later. Joint work with Thomas Adam.
* Do not set a limit on the length of commands when printing them.nicm2015-11-271-4/+5
|
* Push stdout and stderr to clients more aggressively, and add an event tonicm2015-11-141-4/+4
| | | | continue if the send fails.
* If we know the terminal outside tmux is not UTF-8, replace UTF-8 innicm2015-11-121-4/+17
| | | | | error messages and whatnot with underscores the same as we do when we draw UTF-8 characters as part of the screen.
* Use client pointer not file descriptor in logging.nicm2015-10-201-3/+3
|
* Log when cmdq_continue is called.nicm2015-09-161-1/+5
|
* Rename cmd_q dead flag to a general flags bitmask (will be more flags later).nicm2015-09-161-4/+7
|
* Break cmdq_continue inner loop into a helper function.nicm2015-06-171-21/+31
|
* Rewrite of tmux mouse support which was a mess. Instead of havingnicm2015-04-191-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Take a reference to prevent cmdq being freed during the command. Cannicm2015-02-121-2/+5
| | | | | happen to cfg_cmd_q (possibly others) when source-file recurses into cmdq_continue. Fixes bug reported by Ismail Donmez and Theo Buehler.
* There is no need to save the guard state because the function checks itnicm2015-02-051-15/+10
| | | | again anyway.
* Move cfg_causes local into cfg.c and remove struct causelist.nicm2014-10-271-6/+5
|
* Save next item after firing command in case it has added to the queue.nicm2014-10-211-3/+2
|
* Better format for printf format attributes.nicm2014-10-201-3/+3
|
* Various minor style and spacing nits.nicm2014-09-011-4/+4
|
* Remove the "info" message mechanism, this was only used for about fivenicm2014-04-171-32/+1
| | | | | | mostly useless and annoying messages. Change those commands to silence on success like all the others. Still accept the -q command line flag and "quiet" server option for now.
* Remove unnecessary calls to va_start/va_end, from Tiago Cunha.nicm2014-01-091-5/+1
|
* Alter how tmux handles the working directory to internally use filenicm2013-10-101-25/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | descriptors rather than strings. - Each session still has a current working directory. - New sessions still get their working directory from the client that created them or its attached session if any. - New windows are created by default in the session working directory. - The -c flag to new, neww, splitw allows the working directory to be overridden. - The -c flag to attach let's the session working directory be changed. - The default-path option has been removed. To get the equivalent to default-path '.', do: bind c neww -c $PWD To get the equivalent of default-path '~', do: bind c neww -c ~ This also changes the client identify protocol to be a set of messages rather than one as well as some other changes that should make it easier to make backwards-compatible protocol changes in future.
* retcode -> retval for exit message.nicm2013-10-101-2/+2
|
* Support -c for new-session, based on code from J Raynor.nicm2013-10-101-1/+25
|
* Make cmdq->client_exit a tristate (-1 means "not set") so that ifnicm2013-10-101-3/+3
| | | | | explicitly set it can be copied from child to parent cmdq by if-shell and source-file. This fixes using attach or new. From Chris Johnsen.
* Pass flags into cmdq_guard as an argument since sometimes cmdq->cmd cannicm2013-10-101-9/+9
| | | | | be NULL. Avoids crash when a command in a command client can't be parsed.
* Mark control commands specially so the client can identify them, basednicm2013-06-231-3/+6
| | | | on a diff from George Nachman a while back.
* Fix bug where end guard in control mode was not printed after sessionnicm2013-04-101-2/+2
| | | | destroyed, from George Nachman.
* Fix compiler warnings, missing #include. From Thomas Adam.nicm2013-03-261-1/+2
|
* Only send end guard if begin was sent, from George Nachman.nicm2013-03-251-10/+13
|
* Fix a warning.nicm2013-03-251-2/+2
|
* Add time and a command count to control mode guards, based on code fromnicm2013-03-251-15/+26
| | | | George Nachman.
* Add some additional debug logging.nicm2013-03-251-1/+6
|
* Print %%error not %%end guard on error, from George Nachman.nicm2013-03-251-3/+7
|
* Add a command queue to standardize and simplify commands that call othernicm2013-03-241-0/+258
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.