summaryrefslogtreecommitdiffstats
path: root/cmd-display-message.c
AgeCommit message (Collapse)Author
2023-02-05Extend display-message to work for control clients. GitHub issue 3449.nicm
2022-11-03Add a -l flag to display-message to disable format expansion, from Aaronnicm
Jensen. GitHub issue 3372.
2021-10-07Handle splitw -I correctly when used from an attached client, GitHubnicm
issue 2917.
2021-08-21Add args parsing callback for some future work, currently unused.nicm
2021-08-20Hide struct args behind a couple of accessor functions.nicm
2021-08-14Missing argument specifier for -c.nicm
2021-04-12Add a flag to disable keys to close a message, GitHub issue 2625.nicm
2021-04-07When display-message used in config file, show the message after thenicm
config file finishes. GitHub issue 2637.
2020-07-27Add a -d option to display-message to set delay, from theonekeyg atnicm
gmail dot com in GitHub issue 2322.
2020-05-16Support embedded styles in the display-message message, GitHub issuenicm
2206.
2020-04-13Make client -c and -t handling common in cmd-queue.c and try to benicm
clearer about whether the client is the target client (must have a session) or not.
2020-04-13Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make itsnicm
use more clearly defined and preparation for some future work).
2020-04-13Make struct cmd local to cmd.c and move it out of tmux.h.nicm
2019-05-30Remove a leftover abort and some fixes from cppcheck.nicm
2019-05-03Allow panes to be empty (no command), output can be piped to them withnicm
split-window or display-message -I.
2019-03-18Add format variables for the default formats for the various modesnicm
(tree_mode_format and so on) and add a -a flag to display-message to list variables with values.
2019-03-15Add a -v flag to display-message to show verbose messages as the formatnicm
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.
2019-03-14Store the time in the format tree rather than passing it around.nicm
2019-03-14Accept 0 time as a shorthand for now to format_expand_time.nicm
2018-04-23Remove unnecessary brackets.nicm
2018-04-18Change how display-message uses the client. Originally it was onlynicm
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.
2017-05-01In order that people can use formats like #D in #() in the status linenicm
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.
2017-04-22Get rid of the extra layer of flags and cmd_prepare() and just store thenicm
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.
2017-02-03Add a window or pane id "tag" to each format tree and use it to separatenicm
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.
2016-10-16Mass rename struct cmd_q to struct cmdq_item and related.nicm
2016-10-13Trying to do hooks generically is way too complicated and unreliable andnicm
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.
2016-10-10Add static in cmd-* and fix a few other nits.nicm
2016-08-25Do not crash if display-message used without a client, issue reported bynicm
Serge Aleynikov, fix from Thomas Adam.
2015-12-14Instead of combined flags for -c, -s, -t, split into different setsnicm
using an enum and simplify the parsing code.
2015-12-13Use member names in cmd_entry definitions so I stop getting confusednicm
about the order.
2015-12-13-c needs to be able for fail for display-message.nicm
2015-12-13Instead of every command resolving the target (-t or -s) itself, preparenicm
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.
2015-12-11Add cmdq as an argument to format_create and add a format for thenicm
command name (will also be used for more later).
2015-12-08Remove format_create_flags and just pass flags to format_create.nicm
2015-11-18Use format_expand_time for display-message.nicm
2015-04-27Rewrite of the target resolution internals to be simpler and morenicm
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.
2015-02-05Wrap all the individual format_* calls in a single format_defaultsnicm
functions.
2014-10-20Move template defines back into .c files.nicm
2014-10-20Instead of setting up the default keys by building the key structnicm
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.
2013-10-10Trivial style and spacing nits.nicm
2013-03-25Handle no client better in display-message.Nicholas Marriott
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
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.
2013-03-24Fix error reporting for client commands by adding a flag toNicholas Marriott
cmd_find_client to tell it whether or not to show errors, sometimes it's needed and sometimes not.
2012-12-09Use the CMD_*_USAGE defines consistently, from Thomas Adam.Nicholas Marriott
2012-08-14Use a separate define for each default format template and strip clutterNicholas Marriott
from the choose-tree defaults.
2012-07-11Make command exec functions return an enum rather than -1/0/1 values andNicholas Marriott
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.
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-05-22Switch all of the various choose- and list- commands over to the formatNicholas Marriott
infrastructure, from Thomas Adam.
2012-03-03Terminate strftime buffer properly and free format string, whoops. FromNicholas Marriott
Tiago Cunha.
2012-02-23Use format for display-message, based on a diff from George Nachman.Nicholas Marriott