summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-display-message.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add a -d option to display-message to set delay, from theonekeyg atnicm2020-07-271-4/+14
| | | | gmail dot com in GitHub issue 2322.
* Support embedded styles in the display-message message, GitHub issuenicm2020-05-161-2/+2
| | | | 2206.
* Make client -c and -t handling common in cmd-queue.c and try to benicm2020-04-131-10/+9
| | | | | clearer about whether the client is the target client (must have a session) or not.
* Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm2020-04-131-5/+6
| | | | 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-131-4/+4
|
* Remove a leftover abort and some fixes from cppcheck.nicm2019-05-301-3/+2
|
* Allow panes to be empty (no command), output can be piped to them withnicm2019-05-031-4/+13
| | | | split-window or display-message -I.
* Add format variables for the default formats for the various modesnicm2019-03-181-3/+17
| | | | | (tree_mode_format and so on) and add a -a flag to display-message to list variables with values.
* Add a -v flag to display-message to show verbose messages as the formatnicm2019-03-151-4/+9
| | | | | | is parsed, this gives the user a way to debug problems with formats rather than just being confronted with (for example) a blank status line.
* Store the time in the format tree rather than passing it around.nicm2019-03-141-2/+2
|
* Accept 0 time as a shorthand for now to format_expand_time.nicm2019-03-141-2/+2
|
* Remove unnecessary brackets.nicm2018-04-231-5/+3
|
* Change how display-message uses the client. Originally it was onlynicm2018-04-181-6/+18
| | | | | | | | | | | | | intended as the target client where the message should be displayed but at some point (perhaps when -p was added), it was used for format expansion too. This means it can get a bit weird where you have client formats expanding for a client with a different current session than the target session. However, it is nice that display-message can be used to show information about a specific client. So change so that the -c client will be used if the session matches the target session (-t or default), otherwise the best client will be chosen.
* In order that people can use formats like #D in #() in the status linenicm2017-05-011-2/+2
| | | | | | | | | | | | | | 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-221-7/+7
| | | | | | 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.
* Add a window or pane id "tag" to each format tree and use it to separatenicm2017-02-031-2/+2
| | | | | | 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.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-161-10/+11
|
* Trying to do hooks generically is way too complicated and unreliable andnicm2016-10-131-2/+2
| | | | | | | | | | | | | | | | | | 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-101-3/+3
|
* Do not crash if display-message used without a client, issue reported bynicm2016-08-251-2/+3
| | | | Serge Aleynikov, fix from Thomas Adam.
* Instead of combined flags for -c, -s, -t, split into different setsnicm2015-12-141-2/+5
| | | | using an enum and simplify the parsing code.
* Use member names in cmd_entry definitions so I stop getting confusednicm2015-12-131-7/+10
| | | | about the order.
* -c needs to be able for fail for display-message.nicm2015-12-131-2/+2
|
* Instead of every command resolving the target (-t or -s) itself, preparenicm2015-12-131-28/+6
| | | | | | | | | | | | | | | | 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-111-2/+2
| | | | command name (will also be used for more later).
* Remove format_create_flags and just pass flags to format_create.nicm2015-12-081-2/+2
|
* Use format_expand_time for display-message.nicm2015-11-181-9/+2
|
* Rewrite of the target resolution internals to be simpler and morenicm2015-04-271-2/+2
| | | | | | | consistent but with much less duplication, but keeping the same internal API. Also adds more readable aliases for some of the special tokens used in targets (eg "{start}" instead of "^"). Some behaviours may have changed, for example prefix matches now happen before fnmatch.
* Wrap all the individual format_* calls in a single format_defaultsnicm2015-02-051-6/+2
| | | | functions.
* Move template defines back into .c files.nicm2014-10-201-1/+6
|
* Instead of setting up the default keys by building the key structnicm2014-10-201-2/+1
| | | | | | | | | directly with a helper function in the cmd_entry, include a table of bind-key commands and pass them through the command parser and a temporary cmd_q. As well as being smaller, this will allow default bindings to be command sequences which will probably be needed soon.
* Trivial style and spacing nits.nicm2013-10-101-4/+4
|
* Remove the barely-used and unnecessary command check() function.nicm2013-10-101-2/+1
|
* Handle no client better in display-message.nicm2013-03-251-6/+15
|
* Don't let display-message crash if no client, from George Nachman.nicm2013-03-251-2/+5
|
* Add a command queue to standardize and simplify commands that call othernicm2013-03-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* Fix error reporting for client commands by adding a flag tonicm2013-03-241-4/+2
| | | | | cmd_find_client to tell it whether or not to show errors, sometimes it's needed and sometimes not.
* Allow display-message with no curclient.nicm2013-03-241-4/+4
|
* Use the CMD_*_USAGE defines consistently, from Thomas Adam.nicm2012-12-091-2/+3
|
* Use a separate define for each default format template and strip clutternicm2012-08-141-2/+2
| | | | from the choose-tree defaults.
* Make command exec functions return an enum rather than -1/0/1 values andnicm2012-07-111-8/+8
| | | | | | add a new value to mean "leave client running but don't attach" to fix problems with using some commands in a command sequence. Most of the work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
* xfree is not particularly helpful, remove it. From Thomas Adam.nicm2012-07-101-2/+3
|
* Switch all of the various choose- and list- commands over to the formatnicm2012-05-221-2/+2
| | | | infrastructure, from Thomas Adam.
* Terminate strftime buffer properly and free format string, whoops. Fromnicm2012-03-031-3/+6
| | | | Tiago Cunha.
* Use format for display-message, based on a diff from George Nachman.nicm2012-02-231-11/+29
|
* Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'miod2011-04-061-2/+2
| | | | for chars.
* Change -t on display-message to be target-pane for the #[A-Z]nicm2011-03-291-5/+18
| | | | replacements and add -c as target-client.
* Clean up and simplify tmux command argument parsing.nicm2011-01-041-12/+11
| | | | | | | | | | | | | | | | | | | Originally, tmux commands were parsed in the client process into a struct with the command data which was then serialised and sent to the server to be executed. The parsing was later moved into the server (an argv was sent from the client), but the parse step and intermediate struct was kept. This change removes that struct and the separate parse step. Argument parsing and printing is now common to all commands (in arguments.c) with each command left with just an optional check function (to validate the arguments at parse time), the exec function and a function to set up any key bindings (renamed from the old init function). This is overall more simple and consistent. There should be no changes to any commands behaviour or syntax although as this touches every command please watch for any unexpected changes.
* Add a -p flag to display-message to print the output rather than displaying innicm2009-11-241-4/+7
| | | | | the status line, this allows things like "display -p '#W'" to find the current window index.
* Two new options, window-status-format and window-status-current-format, whichnicm2009-11-191-2/+2
| | | | | | | | allow the format of each window in the status line window list to be controlled using similar # sequences as status-left/right. This diff also moves part of the way towards UTF-8 support in window names but it isn't quite there yet.