Commit Graph

60 Commits (master)

Author SHA1 Message Date
Miod Vallat c8a14def9f Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
for chars.
2011-04-06 11:36:26 +00:00
Nicholas Marriott d88c20e718 Change -t on display-message to be target-pane for the #[A-Z]
replacements and add -c as target-client.
2011-03-29 19:30:16 +00:00
Nicholas Marriott 7502cb3adb Clean up and simplify tmux command argument parsing.
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.
2011-01-04 00:42:46 +00:00
Nicholas Marriott 87821fce0e Add a -p flag to display-message to print the output rather than displaying in
the status line, this allows things like "display -p '#W'" to find the current
window index.
2009-11-24 19:16:11 +00:00
Nicholas Marriott 543fb99bc6 Two new options, window-status-format and window-status-current-format, which
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-19 16:22:10 +00:00
Nicholas Marriott ac5b7d518e Don't interpret #() for display-message, it usually doesn't make sense and may
leak commands.
2009-11-19 10:22:06 +00:00
Nicholas Marriott 76ef8770cd Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in the
command entry structs and a couple of functions to check/set the flags.
2009-11-13 19:53:28 +00:00
Nicholas Marriott 6bca92db4d Rather than running status-left, status-right and window title #() with popen
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-10-10 15:03:01 +00:00
Nicholas Marriott 34a82e7629 Make all messages sent between the client and server fixed size.
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-26 12:58:44 +00:00
Nicholas Marriott 6f5150a943 - New command display-message (alias display) to display a message in the
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!
2009-07-17 18:45:08 +00:00