aboutsummaryrefslogtreecommitdiff
path: root/cmd-queue.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).
* Break new window and pane creation common code from various commands andnicm2019-04-17
| | | | 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-12
| | | | | | 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-08
| | | | | 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-07
|
* Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm2017-08-30
| | | | Thomas Sattler.
* Tweak some logging.nicm2017-06-16
|
* Rewrite of choose mode, both to simplify and tidy the code and to addnicm2017-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-01
| | | | | | | | | | | | | | 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-22
| | | | | | 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-21
|
* Clear shared state if not filling it in.nicm2017-04-21
|
* Make the cmd_find_* functions more obvious when looking for a client,nicm2017-04-21
| | | | | rather than having it inside other functions. Should be no change to the way targets are resolved just yet.
* Style nits and an unused struct.nicm2017-04-21
|
* Store state shared between multiple commands in the queue in a sharednicm2017-04-21
| | | | structure.
* Add a window or pane id "tag" to each format tree and use it to separatenicm2017-02-03
| | | | | | 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-05
|
* Give each item on queue a name for better logging.nicm2016-10-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.
* Drain notifys once at the end of the server loop instead of doing itnicm2016-10-15
| | | | 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-14
| | | | | | | 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-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.
* Some improvements and bug fixes for hooks:nicm2016-10-13
| | | | | | | | | | | | | | | | | | | | | - 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-11
|
* Couple of vasprintf -> xvasprintf.nicm2016-09-28
|
* Final parts of command hooks, add before- and after- hooks to each command.nicm2016-04-29
|
* Split out getting the current state from the target search so it can benicm2016-01-19
| | | | replaced if we already know the current.
* I no longer use my SourceForge address so replace it.nicm2016-01-19
|
* 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.
* If command returns error, report it.nicm2015-12-13
|
* Instead of every command resolving the target (-t or -s) itself, preparenicm2015-12-13
| | | | | | | | | | | | | | | | 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-27
|
* Push stdout and stderr to clients more aggressively, and add an event tonicm2015-11-14
| | | | continue if the send fails.
* If we know the terminal outside tmux is not UTF-8, replace UTF-8 innicm2015-11-12
| | | | | 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-20
|
* Log when cmdq_continue is called.nicm2015-09-16
|
* Rename cmd_q dead flag to a general flags bitmask (will be more flags later).nicm2015-09-16
|
* Break cmdq_continue inner loop into a helper function.nicm2015-06-17
|
* Rewrite of tmux mouse support which was a mess. Instead of havingnicm2015-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | 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-12
| | | | | 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-05
| | | | again anyway.
* Move cfg_causes local into cfg.c and remove struct causelist.nicm2014-10-27
|
* Save next item after firing command in case it has added to the queue.nicm2014-10-21
|
* Better format for printf format attributes.nicm2014-10-20
|
* Various minor style and spacing nits.nicm2014-09-01
|
* Remove the "info" message mechanism, this was only used for about fivenicm2014-04-17
| | | | | | 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-09
|
* Alter how tmux handles the working directory to internally use filenicm2013-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.