summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace TAILQ concatenation loop with TAILQ_CONCATbket2020-06-291-7/+2
| | | | | | As a result remove unneeded variables OK @nicm
* Instead of using a custom parse function to process {}, treat it as anicm2020-06-041-8/+10
| | | | | | | set of statements and parse with yacc, then convert back to a string as the last step. This means the rules are consistent inside and outside {}, %if and friends work at the right time, and the final result isn't littered with unnecessary newlines.
* Add a customize mode where keys and options may be browsed and changed,nicm2020-05-161-1/+3
| | | | | includes adding a brief description of each option. Bound to "C" by default.
* When parsing strings, put all commands in one group even if there arenicm2020-04-131-8/+17
| | | | | | newlines. This means that for example bind q { a \n b } and bind q "a ; b" are the same. Also log commands in different groups separated by ;; rather than ; (a command list like this should never be user visible).
* When adding a list of commands to the queue, instead of automaticallynicm2020-04-131-13/+12
| | | | | | | 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).
* Make struct cmd local to cmd.c and move it out of tmux.h.nicm2020-04-131-10/+119
|
* Add support for overlay popup boxes to show text or output temporarilynicm2020-03-241-1/+3
| | | | | above the normal layout. These work similarly to menus and are created with the display-popup command.
* Add ~ to quoted characters for %%%, reported by tb@.nicm2020-01-041-2/+2
|
* Do not lazily use BUFSIZ for "I don't care what size" when buildingnicm2019-10-031-2/+2
| | | | | strings because it is only guaranteed to be 256 bytes and even the default 1024 is not always enough. Reported by Gregory Pakosz.
* It is not longer necessary to double-escape ; in %%%, problem reportednicm2019-08-291-6/+2
| | | | by Theo Buehler.
* Correctly adjust mouse position if the status line is at the top andnicm2019-07-061-3/+3
| | | | more than one line. GitHub issue 1822.
* Use client name when logging command queue.nicm2019-05-251-4/+4
|
* Merge the now tiny cmd-list.c into cmd.c.nicm2019-05-251-1/+80
|
* Make cmd_log_argv take a printf-like format for the prefix.nicm2019-05-251-7/+14
|
* Replace the split parser code (cfg.c and cmd-string.c) with a singlenicm2019-05-231-85/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add support for simple menus usable with mouse or keyboard. New commandnicm2019-05-101-1/+3
| | | | | display-menu shows a menu (bound to the mouse on status line by default) and a couple of extra formats for the default menus.
* Adjust how mouse targets are found so they always have a session, windownicm2019-05-081-7/+12
| | | | and pane.
* Do not store the mouse position we calculate as the start of a drag backnicm2019-05-031-3/+3
| | | | | into the mouse event that later code uses, it has been adjusted and they should use the original position. GitHub issue 1710.
* Fix mouse positioning when the pane is not entirely visible.nicm2019-05-031-5/+4
|
* options_array_item_value cannot return NULL.nicm2019-04-251-5/+1
|
* Indicate an array option with a flag rather than a special type so thatnicm2019-04-231-9/+12
| | | | in future will not have to be strings.
* Make array options a sparse tree instead of an array of char * andnicm2019-03-181-20/+20
| | | | remove the size limit.
* Support for windows larger than visible on the attached client. This hasnicm2018-10-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been a limitation for a long time. There are two new options, window-size and default-size, and a new command, resize-window. The force-width and force-height options and the session_width and session_height formats have been removed. The new window-size option tells tmux how to work out the size of windows: largest means it picks the size of the largest session, smallest the smallest session (similar to the old behaviour) and manual means that it does not automatically resize windows. The default is currently largest but this may change. aggressive-resize modifies the choice of session for largest and smallest as it did before. If a window is in a session attached to a client that is too small, only part of the window is shown. tmux attempts to keep the cursor visible, so the part of the window displayed is changed as the cursor moves (with a small delay, to try and avoid excess redrawing when applications redraw status lines or similar that are not currently visible). The offset of the visible portion of the window is shown in status-right. Drawing windows which are larger than the client is not as efficient as those which fit, particularly when the cursor moves, so it is recommended to avoid using this on slow machines or networks (set window-size to smallest or manual). The resize-window command can be used to resize a window manually. If it is used, the window-size option is automatically set to manual for the window (undo this with "setw -u window-size"). resize-window works in a similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and -A flags. -a sets the window to the size of the smallest client (what it would be if window-size was smallest) and -A the largest. For the same behaviour as force-width or force-height, use resize-window -x or -y, and "setw -u window-size" to revert to automatic sizing.. If the global window-size option is set to manual, the default-size option is used for new windows. If -x or -y is used with new-session, that sets the default-size option for the new session. The maximum size of a window is 10000x10000. But expect applications to complain and much higher memory use if making a window excessively big. The minimum size is the size required for the current layout including borders. The refresh-client command can be used to pan around a window, -U -D -L -R moves up, down, left or right and -c returns to automatic cursor tracking. The position is reset when the current window is changed.
* Log command arguments.nicm2018-08-021-1/+14
|
* Rewrite of choose mode, both to simplify and tidy the code and to addnicm2017-05-301-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Get rid of the extra layer of flags and cmd_prepare() and just store thenicm2017-04-221-175/+1
| | | | | | 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.
* Make the cmd_find_* functions more obvious when looking for a client,nicm2017-04-211-22/+12
| | | | | rather than having it inside other functions. Should be no change to the way targets are resolved just yet.
* server-info can become an alias rather than a command.nicm2017-01-241-3/+1
|
* Add support for custom command aliases, this is an array option whichnicm2017-01-241-4/+66
| | | | | contains items of the form "alias=command". This is consulted when an unknown command is parsed.
* Revert WIP parts of previous I didn't mean to commit yet.nicm2017-01-161-66/+4
|
* getopt() has a struct option so just return to using options_entry.nicm2017-01-161-4/+66
|
* Need to escape ; twice because the command list parser will eat one,nicm2017-01-101-2/+6
| | | | reported by Theo Buehler.
* Quote backslash as well for %%%.nicm2017-01-101-3/+3
|
* Incremental search in copy mode (on for emacs keys by default) - muchnicm2017-01-061-2/+2
| | | | | | the same as normal searching but updates the cursor position and marked search terms as you type. C-r and C-s in the prompt repeat the search, once finished searching (with Enter), N and n work as before.
* Fix the prefer unattached session behaviour ofnicm2016-12-281-2/+3
| | | | attach-session/switch-client, reported by Thomas Sattle.
* Make an empty state on error rather than leaving something partiallynicm2016-11-021-9/+18
| | | | created (which now is now a fatal() later).
* Add %%% to substitute with quotes escaped (convert " to \"). Use thisnicm2016-10-211-6/+14
| | | | | for the prompts in copy mode. Fixes problems with jumping to ' reported by Theo Buehler.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-161-16/+16
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-161-31/+22
| | | | | | | | | | | | | | | 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.
* Some improvements and bug fixes for hooks:nicm2016-10-131-2/+12
| | | | | | | | | | | | | | | | | | | | | - 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.
* Allow cmd_mouse_at return arguments to be NULL.nicm2016-10-051-3/+5
|
* Remove some more unused variables, and use RB_FOREACH_SAFE innicm2016-03-011-2/+1
| | | | key_bindings_unref_table.
* Split out getting the current state from the target search so it can benicm2016-01-191-32/+76
| | | | replaced if we already know the current.
* I no longer use my SourceForge address so replace it.nicm2016-01-191-2/+2
|
* Use cmd_find_clear_state instead of an extra function doing the same.nicm2015-12-141-18/+4
|
* Instead of combined flags for -c, -s, -t, split into different setsnicm2015-12-141-217/+92
| | | | using an enum and simplify the parsing code.
* Use member names in cmd_entry definitions so I stop getting confusednicm2015-12-131-4/+4
| | | | about the order.
* Actually I thought cmd_get_state_client was unnecessary but it will benicm2015-12-131-5/+34
| | | | needed.
* -c needs to be able for fail for display-message.nicm2015-12-131-6/+11
|
* Remove an unnecessary function.nicm2015-12-131-34/+6
|