Instant Terminal Sharing
Go to file
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
arguments.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
array.h Shut up gcc4 warnings. 2010-06-05 16:32:22 +00:00
attributes.c Accept (and document) "none" instead of "default" for attributes as it 2010-05-14 18:56:21 +00:00
cfg.c Allow the config file parser and source-file to return "don't exit" to 2010-12-29 21:28:32 +00:00
client.c Merge the before and after attach client code into one in client.c 2010-10-18 20:00:02 +00:00
clock.c Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last 2009-12-03 22:50:09 +00:00
cmd-attach-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-bind-key.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-break-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-capture-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-choose-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-choose-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-choose-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-choose-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-clear-history.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-clock-mode.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-command-prompt.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-confirm-before.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-copy-mode.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-delete-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-detach-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-display-message.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-display-panes.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-find-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-has-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-if-shell.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-join-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-kill-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-kill-server.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-kill-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-kill-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-last-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-last-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-link-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-buffers.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-clients.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-commands.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-keys.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-panes.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-sessions.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list-windows.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-list.c We now send argv to the server after parsing it in the client to get the 2010-10-29 20:11:57 +00:00
cmd-load-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-lock-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-lock-server.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-lock-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-move-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-new-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-new-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-next-layout.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-next-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-paste-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-pipe-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-previous-layout.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-previous-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-refresh-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-rename-session.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-rename-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-resize-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-respawn-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-rotate-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-run-shell.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-save-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-select-layout.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-select-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-select-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-send-keys.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-send-prefix.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-server-info.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-set-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-set-environment.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-set-option.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-set-window-option.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-show-buffer.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-show-environment.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-show-messages.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-show-options.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-show-window-options.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-source-file.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-split-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-start-server.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-string.c Read ${X} environment variables in strings and $HOME from the global 2010-12-13 22:53:14 +00:00
cmd-suspend-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-swap-pane.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-swap-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-switch-client.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-unbind-key.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd-unlink-window.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
cmd.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
colour.c Permit options such as status-bg to be configured using the entire 256 colour 2009-09-10 17:16:24 +00:00
environ.c Run job commands explicitly in the global enviroment (which can be 2010-04-04 19:02:09 +00:00
grid-utf8.c Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last 2009-12-03 22:50:09 +00:00
grid-view.c Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last 2009-12-03 22:50:09 +00:00
grid.c Merge copy mode and output mode, dropping the latter. Idea and code from 2010-04-06 21:35:44 +00:00
input-keys.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
input.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
job.c Trying to set FD_CLOEXEC on every fd is a lost cause, just use 2010-10-16 08:31:55 +00:00
key-bindings.c Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
key-string.c Last few tables that should be const. 2011-01-01 03:43:20 +00:00
layout-custom.c Custom layouts. list-windows command displays the layout as a string (such as 2010-06-29 03:30:13 +00:00
layout-set.c Add other-pane-height and other-pane-width options, allowing the width 2010-12-19 18:35:08 +00:00
layout-string.c Custom layouts. list-windows command displays the layout as a string (such as 2010-06-29 03:30:13 +00:00
layout.c Custom layouts. list-windows command displays the layout as a string (such as 2010-06-29 03:30:13 +00:00
log.c Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last 2009-12-03 22:50:09 +00:00
Makefile Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
mode-key.c Sprinkle a little more const. 2011-01-01 03:39:21 +00:00
names.c Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last 2009-12-03 22:50:09 +00:00
options-table.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
options.c Permit multiple prefix keys to be defined, separated by commas, for example: 2009-09-22 12:38:10 +00:00
paste.c Change from a per-session stack of buffers to one global stack which is 2010-12-30 23:16:18 +00:00
procname.c Use sysctl() KERN_PROC2 instead of KERN_PROC, as the latter's ABI 2009-12-24 22:29:15 +00:00
resize.c Store sessions in an RB tree by name rather than a list, this is tidier 2010-12-21 22:37:59 +00:00
screen-redraw.c Use UTF-8 line drawing characters on UTF-8 terminals. Fixes some stupid 2010-09-11 16:19:22 +00:00
screen-write.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
screen.c Fix rectangle copy to behave like emacs - the cursor is not part of the 2010-12-11 17:56:01 +00:00
server-client.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
server-fn.c Don't reset the activity timer for unattached sessions every second, 2011-01-01 01:12:09 +00:00
server-window.c Store sessions in an RB tree by name rather than a list, this is tidier 2010-12-21 22:37:59 +00:00
server.c Don't reset the activity timer for unattached sessions every second, 2011-01-01 01:12:09 +00:00
session.c Don't reset the activity timer for unattached sessions every second, 2011-01-01 01:12:09 +00:00
signal.c Do not call event_del() for signals after fork(), just use sigaction() 2010-08-19 18:29:01 +00:00
status.c Handle a # at the end of a replacement string (such as status-left) 2011-01-03 21:30:49 +00:00
tmux.1 Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
tmux.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
tmux.h Clean up and simplify tmux command argument parsing. 2011-01-04 00:42:46 +00:00
tty-acs.c Use UTF-8 line drawing characters on UTF-8 terminals. Fixes some stupid 2010-09-11 16:19:22 +00:00
tty-keys.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
tty-term.c Another table that should be const. 2011-01-01 03:32:28 +00:00
tty.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
utf8.c Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262 2011-01-03 23:35:21 +00:00
window-choose.c Support all four of the xterm mouse modes. Based on a diff from hsim at 2010-12-29 21:49:06 +00:00
window-clock.c Pass in the session, rather than the client, to window modes' key() 2010-05-23 19:42:19 +00:00
window-copy.c Change from a per-session stack of buffers to one global stack which is 2010-12-30 23:16:18 +00:00
window.c Add a function to create window flags rather than doing the same thing 2010-12-30 21:35:17 +00:00
xmalloc.c tabs are better; ok nicm 2009-10-26 21:42:04 +00:00
xterm-keys.c Last few tables that should be const. 2011-01-01 03:43:20 +00:00