aboutsummaryrefslogtreecommitdiff
path: root/cmd-if-shell.c
Commit message (Collapse)AuthorAge
* For the moment, restore if-shell and run-shell to parsing at the lastnicm2021-09-15
| | | | | moment (when the shell command completes) rather than when first invoked, GitHub issue 2872.
* Expand argument to run-shell again.nicm2021-09-09
|
* Validate command argument types (string or command list) and give morenicm2021-08-25
| | | | useful error messages.
* Move command argument parsing common functions and don't bother to parsenicm2021-08-23
| | | | again if given a command rather than a string.
* Stop caring about empty commands, just treat as a null command.nicm2021-08-21
|
* Add args parsing callback for some future work, currently unused.nicm2021-08-21
|
* Hide struct args behind a couple of accessor functions.nicm2021-08-20
|
* Set return code for confirm-before and make command-prompt also block,nicm2021-08-13
| | | | GitHub issue 2822.
* Drop support for popups where the content is provided directly to tmuxnicm2021-03-02
| | | | | | (which does not have many practical uses) and only support running a program in the popup. display-popup is now simpler and can accept multiple arguments to avoid escaping problems (like the other commands).
* Make client -c and -t handling common in cmd-queue.c and try to benicm2020-04-13
| | | | | clearer about whether the client is the target client (must have a session) or not.
* Add helpers for the simple case of parse string and add to command queue.nicm2020-04-13
|
* When adding a list of commands to the queue, instead of automaticallynicm2020-04-13
| | | | | | | 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).
* Move cmdq_state into cmd-queue.c.nicm2020-04-13
|
* Rename cmdq_shared to cmdq_state which will better reflect what it isnicm2020-04-13
| | | | (going to be) used for.
* Store a key event not a mouse event in the shared data.nicm2020-04-13
|
* Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm2020-04-13
| | | | use more clearly defined and preparation for some future work).
* Make struct cmd local to cmd.c and move it out of tmux.h.nicm2020-04-13
|
* Add a flag to run a background process in a pty as well, not used fornicm2020-03-19
| | | | anything yet.
* Use the right client for if -b.nicm2019-07-17
|
* Add a cmdq_continue function rather than twiddling the flag directly.nicm2019-06-18
|
* Pass target on to new commands with if -F.nicm2019-06-12
|
* Fix error handling in if-shell.nicm2019-05-25
|
* 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.
* Memory leaks, from Gang Fan in GitHub issue 1453.nicm2018-08-27
|
* Move job struct into job.c.nicm2018-08-23
|
* Make server_client_get_cwd used (almost) everywhere we need to work outnicm2018-05-24
| | | | | the cwd, and do not fall back to "." as it is pretty useless. GitHub issue 1331.
* Add a missing client-detached hook when the server shuts down, and donicm2018-03-08
| | | | | not exit until jobs started from run-shell/if-shell have finished (add a job flags member and a flag to indicate other jobs). GitHub issue 1245.
* if-shell doesn't need to queue its error message into a callback, and innicm2017-04-25
| | | | | fact it can't do so because the item it was working with will have been freed. Reported by Daniel Hahler.
* 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.
* Fix if-shell without a client (so in the config file). Reported by Theonicm2017-04-22
| | | | Buehler.
* Store state shared between multiple commands in the queue in a sharednicm2017-04-21
| | | | structure.
* If a #() command doesn't exit, use its most recent line of output (itnicm2017-04-20
| | | | | | | must be a full line). Don't let it redraw the status line more than once a second. Requested by someone about 10 years ago...
* Add a helper function for the most common format_create/defaults/expandnicm2017-03-08
| | | | pattern.
* 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.
* 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.
* Add static in cmd-* and fix a few other nits.nicm2016-10-10
|
* Pass file/line to new command for if-shell so that errors appearnicm2016-10-09
| | | | sensibly.
* Expand client formats (like run-shell), from Stephen M Coakley.nicm2016-04-29
|
* Final parts of command hooks, add before- and after- hooks to each command.nicm2016-04-29
|
* Remove some more unused variables, and use RB_FOREACH_SAFE innicm2016-03-01
| | | | key_bindings_unref_table.
* Instead of combined flags for -c, -s, -t, split into different setsnicm2015-12-14
| | | | using an enum and simplify the parsing code.
* Use member names in cmd_entry definitions so I stop getting confusednicm2015-12-13
| | | | about the order.
* 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.
* Add cmdq as an argument to format_create and add a format for thenicm2015-12-11
| | | | command name (will also be used for more later).
* Remove format_create_flags and just pass flags to format_create.nicm2015-12-08
|
* Memory leaks and an uninitialized part of utf8_data, from Patrick Palka.nicm2015-11-20
|
* Because pledge(2) does not allow us to pass directory file descriptorsnicm2015-10-31
| | | | | | | | | around, we can't use file descriptors for the working directory because we will be unable to pass it to a privileged process to tell it where to read or write files or spawn children. So move tmux back to using strings for the current working directory. We try to check it exists with access() when it is set but ultimately fall back to ~ if it fails at time of use (or / if that fails too).