Commit Graph

201 Commits

Author SHA1 Message Date
Nicholas Marriott
747cab4281 No need for $Id$ now. 2014-11-08 12:27:43 +00:00
Thomas Adam
562af864bd Merge branch 'obsd-master'
Conflicts:
	Makefile
	cmd-list-commands.c
	cmd-suspend-client.c
	job.c
	tmux.h
	xmalloc.c
2014-10-21 07:11:44 +01:00
nicm
45dfc5a074 Instead of setting up the default keys by building the key struct
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.
2014-10-20 22:29:25 +00:00
Thomas Adam
2874a431c0 Merge branch 'obsd-master' 2014-09-25 11:29:54 +01:00
nicm
4e956d545a Various minor style and spacing nits. 2014-09-01 21:50:18 +00:00
Thomas Adam
953c3ef47a Merge branch 'obsd-master'
Conflicts:
	Makefile
	tmux.1
	window.c
2014-04-23 11:26:11 +01:00
nicm
a5d4b7f3d9 Some more long lines. 2014-04-17 14:45:49 +00:00
nicm
2740490e27 Remove the "info" message mechanism, this was only used for about five
mostly useless and annoying messages. Change those commands to silence
on success like all the others. Still accept the -q command line flag
and "quiet" server option for now.
2014-04-17 07:55:43 +00:00
nicm
877bdb46ed Extend the -q flag to set-option to suppress errors about unknown
options - this will allow options to be removed more easily.
2014-04-17 07:51:38 +00:00
Thomas Adam
ca1d78f523 Merge branch 'obsd-master' 2014-02-19 15:05:07 +00:00
nicm
1e981f4c6d Don't crash when given a invalid colour, reported by Felix Rosencrantz,
fix from Thomas Adam.
2014-02-17 18:12:47 +00:00
Thomas Adam
b3de4a3dec Merge branch 'obsd-master'
Conflicts:
	tmux.1
	tmux.c
2014-02-16 23:02:07 +00:00
nicm
f835be4bb2 Style nit - no space between function name and bracket. 2014-02-14 13:59:01 +00:00
Thomas Adam
d50e47fc4a Merge branch 'obsd-master'
Conflicts:
	Makefile
	cmd-server-info.c
	cmd-start-server.c
2014-01-31 21:39:56 +00:00
nicm
945339b443 Allow replacing each of the many sets of separate foo-{fg,bg,attr}
options with a single foo-style option. For example:

    set -g status-fg yellow
    set -g status-bg red
    set -g status-attr blink

Becomes:

    set -g status-style fg=yellow,bg=red,blink

The -a flag to set can be used to add to rather than replace a style. So:

    set -g status-bg red

Becomes:

    set -ag status-style bg=red

Currently this is fully backwards compatible (all *-{fg,bg,attr} options
remain) but the plan is to deprecate them over time.

From Tiago Cunha.
2014-01-28 23:07:09 +00:00
nicm
d45c12b6c9 Remove the barely-used and unnecessary command check() function. 2013-10-10 12:00:18 +00:00
Nicholas Marriott
a36da3a878 Remove the barely-used and unnecessary command check() function. 2013-08-21 18:01:40 +01:00
Thomas Adam
bdea2f9eda Merge branch 'obsd-master' 2013-07-06 11:18:49 +01:00
Nicholas Marriott
a96a8a1aab Clarify error messages when setting options, from Thomas Adam. 2013-07-05 15:10:38 +00:00
Nicholas Marriott
a05b8c4143 Add a -o option to set-option to prevent setting an option already set,
from Thiago Padilha.
2013-03-24 09:55:02 +00:00
Nicholas Marriott
0c0953f3bd Add user options, prefixed with @. May be set to any arbitrary string. 2013-03-21 16:17:01 +00:00
Nicholas Marriott
be13479f09 Add a -o option to set-option to prevent setting an option already set, from
Thiago Padilha.
2013-02-23 23:22:03 +00:00
Nicholas Marriott
3964309c67 Add a command queue to standardize and simplify commands that call other
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-02-23 22:25:58 +00:00
Nicholas Marriott
caa29af2a9 Add user options, prefixed with @. May be set to any arbitrary string. 2013-02-13 09:54:24 +00:00
Nicholas Marriott
102cb77435 Add -v to set and setw to show only option value. 2013-02-12 20:12:10 +00:00
Tiago Cunha
1f5e6e35d5 Sync OpenBSD patchset 1151:
Make command exec functions return an enum rather than -1/0/1 values and
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-11 19:37:32 +00:00
Tiago Cunha
a432fcd306 Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
2012-07-11 19:34:16 +00:00
Nicholas Marriott
ede8312d59 Make command exec functions return an enum rather than -1/0/1 values and
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-11 07:10:15 +00:00
Nicholas Marriott
df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Tiago Cunha
ce67a44a94 Sync OpenBSD patchset 1091:
Do not fire name timer when automatic-rename is off, from Tim Ruehsen a
while ago.
2012-04-10 09:57:08 +00:00
Nicholas Marriott
631d6b59fd Do not fire name timer when automatic-rename is off, from Tim Ruehsen a
while ago.
2012-04-08 06:47:26 +00:00
Tiago Cunha
68ba5377e3 Sync OpenBSD patchset 1063:
Add -q option to set-option to turn off info message, from marcel partap.
2012-03-18 02:09:51 +00:00
Nicholas Marriott
f152379e5a Add -q option to set-option to turn off info message, from marcel partap. 2012-03-17 21:33:33 +00:00
Tiago Cunha
95f427c34e Sync OpenBSD patchset 1032:
Allow a single option to be specified to show-options to show just that
option.
2012-03-03 09:16:52 +00:00
Nicholas Marriott
4e7de210e4 Allow a single option to be specified to show-options to show just that
option.
2012-02-25 12:57:42 +00:00
Tiago Cunha
a7b0b30bdd Sync OpenBSD patchset 1007:
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).
2012-01-21 19:36:40 +00:00
Nicholas Marriott
535286c05a Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).
2012-01-21 08:40:09 +00:00
Tiago Cunha
391f1f08c0 Expand the Id keyword. 2011-07-09 09:42:33 +00:00
Nicholas Marriott
4e452a2e11 |PatchSet 882
|Date: 2011/04/05 20:37:01
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Add a flag to cmd_find_session so that attach-session can prefer
|unattached sessions when choosing the most recently used (if -t is not
|given). Suggested by claudio@.
2011-04-06 22:24:01 +00:00
Nicholas Marriott
d9cb059e34 |PatchSet 879
|Date: 2011/03/29 22:09:13
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|For convenience, work out what type of option is being set by name
|regardless of the -s or -w flags (these remain documented however).
2011-04-06 22:22:49 +00:00
Nicholas Marriott
ec3be580ec |PatchSet 878
|Date: 2011/03/29 22:07:08
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Checking for particular options and redrawing is not necessary as we
|already redraw unconditionally.
2011-04-06 22:22:25 +00:00
Nicholas Marriott
02462e5e57 |PatchSet 877
|Date: 2011/03/29 21:31:22
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Update an out-of-date and inaccurate comment.
2011-04-06 22:21:24 +00:00
Nicholas Marriott
5d519ba526 Add a flag to cmd_find_session so that attach-session can prefer
unattached sessions when choosing the most recently used (if -t is not
given). Suggested by claudio@.
2011-04-05 19:37:01 +00:00
Nicholas Marriott
f7e9aedf10 For convenience, work out what type of option is being set by name
regardless of the -s or -w flags (these remain documented however).
2011-03-29 21:09:13 +00:00
Nicholas Marriott
beb6db9b5f Checking for particular options and redrawing is not necessary as we
already redraw unconditionally.
2011-03-29 21:07:08 +00:00
Nicholas Marriott
25d551e8b2 Update an out-of-date and inaccurate comment. 2011-03-29 20:31:22 +00:00
Tiago Cunha
3d7b8105e1 Sync OpenBSD patchset 855:
Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
2011-02-15 15:20:03 +00:00
Nicholas Marriott
db7a89b1ee Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
2011-01-26 01:54:56 +00:00
Tiago Cunha
ca413cf270 Sync OpenBSD patchset 831:
Now that parsing is common, merge some of the small, related commands
together to use the same code.

Also add some arguments (such as -n and -p) to some commands to match
existing commands.
2011-01-07 15:02:38 +00:00
Tiago Cunha
b2b5d88f3f Sync OpenBSD patchset 830:
argc will be 1 not 2 with no option value.
2011-01-07 14:51:54 +00:00