aboutsummaryrefslogtreecommitdiff
path: root/cfg.c
Commit message (Collapse)AuthorAge
* Expand command formats in %if and move the config file loading later (tonicm2019-06-20
| | | | | when the first client has identified) so all the client formats are available, fixes problems reported by Thomas Sattler.
* Add a cmdq_continue function rather than twiddling the flag directly.nicm2019-06-18
|
* Add a -v flag to source-file to show the commands and line numbers.nicm2019-06-05
|
* Fix line numbers - commands are added after the line ends so they need tonicm2019-05-23
| | | | get line - 1.
* Replace the split parser code (cfg.c and cmd-string.c) with a singlenicm2019-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix ordering of source-file with multiple files and add flags to load_cfg.nicm2019-05-20
|
* Fix order of insertion in load_cfg.nicm2019-05-03
|
* Pass target client and session to load_cfg from source-file so formatsnicm2019-04-18
| | | | work. Reported by Thomas Sattler.
* Do not load /etc/tmux.conf if given -f.nicm2019-04-03
|
* 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
|
* Use starting client cwd in config file, GitHub issue 1606.nicm2019-02-16
|
* Some unused code, GitHub issue 1219.nicm2018-01-15
|
* Support %else in config files to match %if, from Brad Town in GitHubnicm2017-10-06
| | | | issue 1071.
* 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.
* Block the initial client if there is one until the configuration filenicm2017-04-25
| | | | has finished loading.
* History needs to be loaded after config parsing is done - now thatnicm2017-04-21
| | | | commands are queued, that's in cfg_done not after start_cfg finishes.
* Do not run the config file in the context of the first client, insteadnicm2017-04-21
| | | | | use no client like we did before. This means commands like new-session won't try to attach if they are in the config file.
* cfg_file can be static.nicm2017-04-05
|
* 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.
* It is silly for cmd_list_parse to return an integer error when it couldnicm2017-01-15
| | | | just return NULL.
* Add %if/%endif for conditionals when parsing configuration files, thenicm2017-01-09
| | | | argument is a format (the new == and != are useful).
* Run the source-file pattern through glob(3).nicm2017-01-09
|
* 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.
* 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.
* Some other stuff that can be local to one file.nicm2016-10-11
|
* Loads more static, except for cmd-*.c and window-*.c.nicm2016-10-10
|
* - Rework load_cfg() error handling a little.tim2016-05-12
| | | | | | - Add -q to source-file to suppress errors about nonexistent files. Input and OK nicm@
* I no longer use my SourceForge address so replace it.nicm2016-01-19
|
* Use __unused rather than rolling our own.nicm2015-11-18
|
* No need to keep global options around for client which doesn't use them.nicm2015-09-09
|
* Work out config file when needed not at startup.nicm2015-09-01
|
* Move initial conf load into cfg.c.nicm2015-09-01
|
* Change deref to the more sensible unref, and add a couple I missed before.nicm2015-06-05
|
* Style spacing nits.nicm2015-05-07
|
* Reset cfg_ncauses to 0 as well or we could allocate the wrong size ifnicm2015-04-27
| | | | called again.
* Fix some char* -> char *.nicm2015-04-25
|
* Use a char **,u_int pair for cfg_causes.nicm2015-04-25
|
* 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.
* Move cfg_causes local into cfg.c and remove struct causelist.nicm2014-10-27
|
* Handle escaped back slashes and missing new lines at end of line by usingtobias2014-06-25
| | | | | | fparseln instead of reimplementing it on our own. with input by and ok nicm@
* Remove some unnecessary includes and fix a typo.nicm2014-04-17
|
* Do not run any command line command from the client which starts thenicm2013-10-20
| | | | | | server until after the configuration file completes. This prevents it racing against run-shell or if-shell in .tmux.conf that run in the background.
* Add some additional debug logging.Nicholas Marriott2013-03-25
|
* Add a command queue to standardize and simplify commands that call otherNicholas Marriott2013-03-24
| | | | | | | | | | | | | | | | | | | | | | 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.
* Need to set clients in context before changing their reference count.Nicholas Marriott2013-03-22
|
* load_cfg can actually use the same context now they are reference counted.Nicholas Marriott2013-03-22
|