Commit Graph

49 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
4c42381410 Move template defines back into .c files. 2014-10-20 23:35:28 +00: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
nicm
d45c12b6c9 Remove the barely-used and unnecessary command check() function. 2013-10-10 12:00:18 +00:00
Nicholas Marriott
b2fe9bff3f Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code 2013-08-21 18:03:07 +01:00
Nicholas Marriott
a36da3a878 Remove the barely-used and unnecessary command check() function. 2013-08-21 18:01:40 +01:00
Thomas
aa4920fea3 choose-tree: Reset top when toggling items
When choose-tree is told to expand/collapse items (especially when first
rendering collapsed to just show sessions), ensure that in addition to
setting the selected item, that the item itself appears on the bottom of the
screen, rather than off screen.

This was causing rendering glitches when a very small tmux window tried to
render a list of items in choose-tree much larger than itself, and the
selected item appeared off screen, and didn't show the selection until the
selection had wrapped around to the top of the screen.
2013-08-20 00:05:28 +01:00
Thomas Adam
cd60e57b6a Merge branch 'obsd-master'
Sync from OpenBSD.
2013-04-23 08:26:04 +01:00
Nicholas Marriott
3d2b7d5bce When using choose-tree -u, start with the current window
highlighted. From Thomas Adam.
2013-04-22 22:17:29 +00:00
Nicholas Marriott
04f54ab38f Get session of -t window rather than client's window. 2013-04-22 16:34:53 +00:00
Nicholas Marriott
20636d956d 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-03-24 09:54:10 +00:00
Nicholas Marriott
48291f0eeb Make choose-tree actually work again. 2013-03-21 16:53:12 +00:00
Nicholas Marriott
66414029a1 Run session command before window in choose-tree. 2013-03-21 16:23:07 +00:00
Nicholas Marriott
180faf73af Allow choose commands to be used outside tmux, so long as at least one
client is attached.
2013-03-21 16:09:59 +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
4f01bfc4bc Make choose-tree actually work again. 2013-02-15 12:57:13 +00:00
Nicholas Marriott
6e03b50771 Run session command before window in choose-tree. 2013-02-13 11:05:10 +00:00
Nicholas Marriott
544c80d715 Fix constness of cmd_template_replace. 2013-02-13 10:19:43 +00:00
Nicholas Marriott
36fe146a74 Fix choose-tree usage. 2013-02-13 09:55:37 +00:00
Nicholas Marriott
f1ce95915c Allow choose commands to be used outside tmux, so long as at least one client
is attached.
2013-02-10 17:52:51 +00:00
Nicholas Marriott
aadc87f5a7 Remove free callback for window_choose_data objects. 2013-02-10 17:36:58 +00:00
Nicholas Marriott
4d382ae8e6 Miscellaneous tidying of choose API, including:
- rename client and session to start_client and start_session in
  window_choose_data struct. also add TREE_OTHER define and reorder the
  struct
- rename window_choose_ctx to window_choose_data_run
- don't pass a cmd_ctx into window_choose_create (will let it use a
  different client later). instead take type, session, client
- add window_choose_data_free and use it to dispose of wcd rather than
  each cmd-*.c doing it individually
- change so ref counting is done by wcd_add and wcd_free rather than
  callers. this means 1 ref for each item but what of it :-)
- also add a ref to tree_session - not sure if this is needed?
- all the callbacks except choose-client and find-window are the same so
  remove them and add window_choose_default_callback
- reorder/rename some other bits and pieces for tidyness
2013-02-10 17:32:58 +00:00
Thomas Adam
2ca8b7f359 Merge branch 'obsd-master' 2013-01-17 22:14:18 +00:00
Nicholas Marriott
d31315884c Fix some blank line nits. 2013-01-17 03:51:21 +00:00
Thomas Adam
675c6b3773 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-12-31 18:50:37 +00:00
Nicholas Marriott
b18ff67646 Add a -u flag to choose-tree to start uncollapsed, from Raghavendra D
Prabhu.
2012-12-24 12:25:52 +00:00
Nicholas Marriott
ce0b285aad Fix up missing bits. 2012-09-25 08:54:01 +01:00
Nicholas Marriott
eb0ad181e9 Use ACS characters for choose-tree arrows based on diff from Romain
Francoise.
2012-09-24 12:53:55 +00:00
Nicholas Marriott
a1cd0eee1b Use the right index when adding item in choose-tree, from Thomas Adam. 2012-09-04 22:37:31 +01:00
Nicholas Marriott
996a636713 Remove an unused variable. 2012-09-04 22:36:56 +01:00
Nicholas Marriott
0304555184 Change format of choose-tree arrows slightly, from Romain Francoise. 2012-09-04 22:35:52 +01:00
Nicholas Marriott
4f8a6867fa Use the right index when adding item in choose-tree, from Thomas Adam. 2012-09-03 12:24:25 +00:00
Nicholas Marriott
adc9fad4ac Remove an unused variable. 2012-09-03 09:36:07 +00:00
Nicholas Marriott
a679a4a708 Change format of choose-tree arrows slightly, from Romain Francoise. 2012-09-03 09:01:16 +00:00
Tiago Cunha
1c608031b5 Sync OpenBSD patchset 1162:
Use a separate define for each default format template and strip clutter
from the choose-tree defaults.
2012-08-31 09:18:50 +00:00
Nicholas Marriott
73c6785538 Use a separate define for each default format template and strip clutter
from the choose-tree defaults.
2012-08-14 08:51:53 +00:00
Tiago Cunha
45d68963ab Sync OpenBSD patchset 1157:
Fix a return type.
2012-08-12 19:29:05 +00:00
Nicholas Marriott
8889a48f9b Fix a return type. 2012-08-11 06:46:47 +00:00
Tiago Cunha
d697b5ef20 Sync OpenBSD patchset 1152:
Nuke unused variable from Thomas Adam.
2012-07-12 21:14:46 +00:00
Nicholas Marriott
35a8a61254 Nuke unused variable from Thomas Adam. 2012-07-12 13:03:42 +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
Tiago Cunha
188be9718e Sync OpenBSD patchset 1148:
Fix choose-tree usage string.
2012-07-11 17:16:25 +00:00
Tiago Cunha
a10143a2d1 Sync OpenBSD patchset 1146:
Add choose-tree command to show windows and sessions in the same
list. Change choose-window and -session to use the same code. From
Thomas Adam.
2012-07-11 17:13:55 +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
Nicholas Marriott
91f54b59ac Fix choose-tree usage string. 2012-07-09 07:08:03 +00:00
Nicholas Marriott
f20c6fe009 Add choose-tree command to show windows and sessions in the same
list. Change choose-window and -session to use the same code. From
Thomas Adam.
2012-07-08 16:04:38 +00:00