aboutsummaryrefslogtreecommitdiff
path: root/hooks.c
Commit message (Collapse)AuthorAge
* Merge hooks into options and make each one an array option. This allowsnicm2019-04-26
| | | | | | | 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).
* Remove unused hooks_run function, from Thomas Adam.nicm2018-01-18
|
* Provide a way for hooks to tag formats onto the commands they fire sonicm2016-10-16
| | | | | 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-16
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-16
| | | | | | | | | | | | | | | 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.
* Trying to do hooks generically is way too complicated and unreliable andnicm2016-10-13
| | | | | | | | | | | | | | | | | | 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.
* Loads more static, except for cmd-*.c and window-*.c.nicm2016-10-10
|
* Add infrastructure to work out the best target given a pane or windownicm2015-12-16
| | | | alone and use it to add pane_died and pane_exited hooks.
* Some hooks API changes to fire a hook while waiting another cmdq andnicm2015-12-15
| | | | infrastructure that will be needed soon.
* We cannot do hooks_find and then hooks_remove because it might have comenicm2015-12-11
| | | | | | | from the parent (global) tree, instead make it remove by name like options. While here, also tidy up a few bits of options and hooks handling (use RB_FOREACH_SAFE, and a helper function for the free).
* Add hooks infrastructure, basic commands (set-hook, show-hooks) and anicm2015-12-08
couple of not very useful client hooks. This will eventually let commands be run at various points and on notifications. Joint work with Thomas Adam.