summaryrefslogtreecommitdiffstats
path: root/cmd-display-message.c
AgeCommit message (Collapse)Author
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
2011-04-06Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'Miod Vallat
for chars.
2011-03-29Change -t on display-message to be target-pane for the #[A-Z]Nicholas Marriott
replacements and add -c as target-client.
2011-01-04Clean up and simplify tmux command argument parsing.Nicholas Marriott
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.
2009-11-24Add a -p flag to display-message to print the output rather than displaying inNicholas Marriott
the status line, this allows things like "display -p '#W'" to find the current window index.
2009-11-19Two new options, window-status-format and window-status-current-format, whichNicholas Marriott
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.
2009-11-19Don't interpret #() for display-message, it usually doesn't make sense and mayNicholas Marriott
leak commands.
2009-11-13Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in theNicholas Marriott
command entry structs and a couple of functions to check/set the flags.
2009-10-10Rather than running status-left, status-right and window title #() with popenNicholas Marriott
immediately every redraw, queue them up and run them in the background, starting each once every status-interval. The actual status line uses the output from the last run. This brings several advantages: - tmux itself may be called from inside #() without causing the server to hang; - likewise, sleep or similar doesn't cause the server to block; - commands aren't run excessively often when redrawing; - commands shared by status-left and status-right, or used multiple times, will only be run once. run-shell and if-shell still use system()/popen() but will be changed over to use this too later.
2009-07-26Make all messages sent between the client and server fixed size.Nicholas Marriott
This is the first of two changes to make the protocol more resilient and less sensitive to other changes in the code, particularly with commands. The client now packs argv into a buffer and sends it to the server for parsing, rather than doing it itself and sending the parsed command data. As a side-effect this also removes a lot of now-unused command marshalling code. Mixing a server without this change and a client with or vice versa will cause tmux to hang or crash, please ensure that tmux is entirely killed before upgrading.
2009-07-17- New command display-message (alias display) to display a message in theNicholas Marriott
status line (bound to "i" and displays the current window and time by default). The same substitutions are applied as for status-left/right. - Add support for including the window index (#I), pane index (#P) and window name (#W) in the message, and status-left or status-right. - Bump protocol version. From Tiago Cunha, thanks!