aboutsummaryrefslogtreecommitdiff
path: root/cmd-find.c
Commit message (Collapse)AuthorAge
* Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm2017-08-30
| | | | Thomas Sattler.
* Do not forbid targets to specify non-visible panes - the checks fornicm2017-08-28
| | | | visibility are better where the target is used. GitHub issue 1049.
* When working out the current client (for example for switch-client withnicm2017-07-07
| | | | | no target), prefer clients attached to the current session if there is one. GitHub issue 995 from Jan Larres.
* Tweak some logging.nicm2017-06-16
|
* Add missing error message when no target, GitHub issue 971.nicm2017-06-14
|
* Do not need getopt.h.nicm2017-04-22
|
* 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
|
* Make sure cmd_find_from_* clear the state if they fail.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.
* Add cmd_find_from_winlink_pane and use it in a couple of places, andnicm2017-04-21
| | | | make functions that can't fail void.
* More unnecessary arguments now winlink points back to session.nicm2017-04-21
|
* Store state shared between multiple commands in the queue in a sharednicm2017-04-21
| | | | structure.
* Try again to resolve problems with mistaking sessions for windows: nownicm2017-04-05
| | | | | | | | | | do not look up windows as sessions (and panes as windows) when they are qualified with a ':' or a '.'. So 'foo' as a window target will look for windows and sessions called 'foo', but ':foo' will only look for windows, and 'foo:' only for sessions. This means the common case of using an unadorned session as a window target (send -tfoo) should continue to work, but an explicit window will not get confused with a session (send -t:foo).
* Give each client a name. This defaults to the tty name as before butnicm2017-04-05
| | | | | | | falls back to an alternative if the tty name is not available. This is clearer than overloading the client ttyname member and allows us to remove the path stored in the tty struct, it should always be the same as the client.
* Revert previous, breaks normal short targets, reported by Theo Buehler.nicm2017-03-13
|
* Only look for window and pane parts of target as a sesson and window ifnicm2017-03-11
| | | | they look like an ID.
* The target validity check used window_pane_visible but that may be falsenicm2016-11-16
| | | | | | | if the pane is zoomed, so instead add a new function to just check if the pane is actually on screen (most commands still want to accept panes invisible by zoom). Also reject panes outside the window for various special targets. Problem reported by Sean Haugh.
* Tweak a couple of log statements.nicm2016-10-18
|
* Use the notify name string instead of going via an enum and changenicm2016-10-16
| | | | existing hooks to use notifys instead.
* 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.
* Fire hooks on the simple notifys (window-renamed and session-renamed),nicm2016-10-15
| | | | the complicated ones get no hooks for now (more to come).
* 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 cmd-* and fix a few other nits.nicm2016-10-10
|
* Accept clients as sessions in cmd_find_get_session.nicm2016-03-03
|
* 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 hooks for alerts (bell, silence, activity), from Thomas Adam.nicm2016-01-16
|
* As well as setting up the state, actually use it in cmd_find_target.nicm2015-12-17
|
* 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.
* Copy state directly rather than dereferencing wl (which could be NULL).nicm2015-12-15
|
* We changed somewhat recently to us the pty when tmux was run insidenicm2015-12-15
| | | | | | | | | | itself to work out the current pane. This is confusing in many cases (particularly notable is that "tmux neww\; splitw" would not split the new window), and the few advantages do not make up for the confusion. So drop this behaviour and return to using the current window and pane; keep the pty check but only use it to limit the list of possible current sessions.
* Don't copy marked pane when can just point to it.nicm2015-12-15
|
* Make the marked pane a cmd_find_state.nicm2015-12-15
|
* Use cmd_find_clear_state instead of an extra function doing the same.nicm2015-12-14
|
* Use struct cmd_find_state directly and remove cmd_state_flag, alsonicm2015-12-13
| | | | change so that winlink is set even if an index is too.
* Change cmd_find_target to use a state struct from the caller.nicm2015-12-13
|
* Remove the cmd_find_{session,window,pane,index} functions (which arenicm2015-12-13
| | | | | just wrappers around cmd_find_target) and just use cmd_find_target directly.
* Move logging into cmd_find_target rather than each function.nicm2015-12-13
|
* Like options, move the environ struct into environ.c.nicm2015-10-28
|
* Break the common process set up, event loop and imsg dispatch codenicm2015-10-27
| | | | | between server and client out into a separate internal API. This will make it easier to add another process.
* If $TMUX is set, and we are unsure about the session, use it.nicm2015-10-23
|
* If the pane is still on all_window_panes but not actually connected tonicm2015-10-22
| | | | | | window or session (which can happen if it is killed during a command sequence and something else has a reference), fall back to the best effort. Fixes "tmux killw\; detach" for Rudis Muiznieks.
* Remove some extra blank lines.nicm2015-09-14
|
* right-up should be right-of, also rename the values too.nicm2015-08-13
|
* Rename left/right/up/down relative to active pane to add -of suffixnicm2015-08-12
| | | | | (left-of/right-of/etc) to remove conflict with left/right meaning leftmost or rightmost pane. From Ben Boeckel.
* Fix a warning.nicm2015-06-05
|
* Make it so that if a window or session target is prefixed with an =,nicm2015-06-05
| | | | | only an exact name or index match is accepted, no special character, prefix match, or fnmatch.
* Add support for a single "marked pane". There is one marked pane in thenicm2015-06-04
| | | | | | | | | server at a time; it may be toggled or cleared with select-pane -m and -M (the border is highlighted). A new target '~' or '{marked}' specifies the marked pane to commands and it is the default target for the swap-pane and join-pane -s flag (this makes them much simpler to use - mark the source pane and then change to the target pane to run swapp or joinp).