Commit Graph

1116 Commits

Author SHA1 Message Date
Nicholas Marriott 7f191c7951 Add -P and -F to new-session. 2013-03-22 17:01:15 +00:00
Nicholas Marriott 6ddb06d372 Extend jobs to support writing and use that for copy-pipe instead of popen,
from Chris Johnsen.
2013-03-21 14:24:33 +00:00
Nicholas Marriott c5ad47ee7c Only send end guard if begin was sent, from George Nachman. 2013-03-13 07:31:36 +00:00
Nicholas Marriott c41d92d27a Add time and a command count to control mode guards, based on code from George
Nachman.
2013-03-11 09:35:44 +00:00
Nicholas Marriott f47a063841 Rename session idx to session id throughout and add $ prefix to targets to use
it, extended from a diff from George Nachman.
2013-03-07 10:07:22 +00:00
Nicholas Marriott 7fd4d49d56 Add a wait-for command which blocks a client on a named channel until it is
wokrn up again (with wait-for -S). From Thiago Padilha.
2013-03-06 09:57:26 +00:00
Nicholas Marriott aaeee34c32 Preserve trailing spaces with capture-pane -J, from George Nachman. 2013-03-04 11:03:03 +00:00
Nicholas Marriott f339cfd315 Add -A flag to new-session to make it behave like attach-session if the session
exists. If -A is used, -D behaves like -d to attach-session.
2013-02-24 00:43:28 +00:00
Nicholas Marriott c5239c5984 Add resize-pane -Z to temporary zoom the active pane to occupy the full window
or unzoom (restored to the normal layout) if it already zoomed, bound to C-b z
by default. The pane is unzoomed on pretty much any excuse whatsoever.

We considered making this a new layout but the requirements are quite different
from layouts so decided it is better as a special case. Each current layout
cell is saved, a temporary one-cell layout generated and all except the active
pane set to NULL.

Prompted by suggestions and scripts from several. Thanks to Aaron Jensen and
Thiago Padilha for testing an earlier version.
2013-02-24 00:25: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 ee0f8adfac Handle focus events from the terminal, from Aaron Jensen. 2013-02-23 10:01:34 +00:00
Nicholas Marriott 3a2e9d805a Fix error reporting for client commands by adding a flag to cmd_find_client to
tell it whether or not to show errors, sometimes it's needed and sometimes not.
2013-02-22 23:04:53 +00:00
Nicholas Marriott 1994ae4640 Missing PANE_RESIZE define. 2013-02-22 21:47:34 +00:00
Nicholas Marriott 4c9f9438ff Add support for focus notifications when tmux pane changes, based on work by
Aaron Jensen.
2013-02-22 07:23:11 +00:00
Nicholas Marriott 8c50f625b0 Add session_set_current helper function, extracted from a diff from Aaron
Jensen.
2013-02-21 16:54:13 +00:00
Nicholas Marriott b8b5631d9d Add -C and -J to capture pane to escape control sequences and to join wrapped
line, based on a diff from George Nachman.
2013-02-21 09:35:01 +00:00
Nicholas Marriott afd5e978cf Need to set clients in context before changing their reference count. 2013-02-20 10:25:15 +00:00
Nicholas Marriott c3859d1df1 Add copy-pipe mode command to copy selection and also pipe to a command. 2013-02-19 17:49:53 +00:00
Nicholas Marriott 4d1d4d6e8e Add -e flag to capture-pane to include embedded ANSI SGR escape sequences, from
George Nachman.
2013-02-19 09:55:02 +00:00
Nicholas Marriott 293e331d69 Add functions to allocate and free command contexts rather than doing it all on
the stack.
2013-02-18 23:20:21 +00:00
Nicholas Marriott 44452823b7 Fix double space in sessions template. 2013-02-18 17:12:58 +00:00
Nicholas Marriott e4bb87032e Add resize-pane -x and -y for absolute pane size. 2013-02-18 17:00:35 +00:00
Nicholas Marriott e5eee7de0c Support the latest theory for mouse input, this is enabled/disabled with SM/RM
1006 and is similar in style to SGR input: \033[<b;x;yM or \033[b;x;ym. From
Egmont Koblinger.
2013-02-18 14:52:27 +00:00
Nicholas Marriott cf2c0237f4 Instead of loads of little screen_write_*_on and off functions which just
change mode flags, just have screen_write_mode_set and screen_write_mode_clear.
2013-02-17 10:43:35 +00:00
Nicholas Marriott 10db7ec51b Include the \033 in the key tree and adjust key matching for this change. 2013-02-16 13:21:14 +00:00
Nicholas Marriott 82355d2f2d Tidy by splitting default key tables into two. 2013-02-15 02:16:41 +00:00
Nicholas Marriott 68e370574a Fix constness of window_choose_add_item and _window. 2013-02-13 10:25:37 +00:00
Nicholas Marriott 544c80d715 Fix constness of cmd_template_replace. 2013-02-13 10:19:43 +00:00
Nicholas Marriott 102cb77435 Add -v to set and setw to show only option value. 2013-02-12 20:12:10 +00:00
Nicholas Marriott 99cc0015f8 Rework reflow code so it does not do so much allocation which should be faster
with large histories.
2013-02-10 18:15:30 +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 64da762c15 Merge branch 'obsd-master' 2013-02-07 12:08:55 +00:00
Nicholas Marriott 8903c1f167 Automatically reflow wrapped lines when a pane is resized, requested by
many over the years and finally implemented by Richard Woodbury.
2013-02-05 11:08:59 +00:00
Thomas Adam a3f4eb7b24 Merge branch 'obsd-master'
Conflicts:
	Makefile
	grid-utf8.c
2013-01-30 15:27:19 +00:00
Nicholas Marriott fdbfc7e349 Rather than having two grids for each pane, one for ASCII and one for
UTF-8, collapse the two together. Simplifies the code at the expense of
more memory (which can probably be reduced again later).
2013-01-18 02:16:21 +00:00
Thomas Adam de194016ec Merge branch 'obsd-master' 2013-01-17 01:38:21 +00:00
Nicholas Marriott e33ba57c13 Remove the layout undo/redo code which never really worked. 2013-01-17 00:11:22 +00:00
Nicholas Marriott 44f8e1caff Implement ECH (erase character, CSI X). Reported by Christian Neukirchen. 2013-01-15 23:18:55 +00:00
Nicholas Marriott bc2e4a36df If timing between keys is less than (by default) 1 millisecond, assume
the text is being pasted. assume-paste-time option changes the value (0
disables). Based on a diff from Marcin Kulik.
2013-01-15 22:55:29 +00:00
Thomas Adam 675c6b3773 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-12-31 18:50:37 +00:00
Nicholas Marriott a2c8af97e9 Add missing function prototype. 2012-12-24 12:33:05 +00:00
Thomas Adam fb83914bd7 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-12-08 20:29:37 +00:00
Nicholas Marriott 8264e92b37 Fix return value of load_cfg, from Thomas Adam. 2012-11-27 22:59:34 +00:00
Thomas Adam 739a76634c Merge branch 'obsd-master'
Sync from OpenBSD.
2012-11-27 22:24:00 +00:00
Nicholas Marriott 47c097cb51 Support middle-click paste, based on a diff from Ailin Nemui. 2012-11-27 20:22:12 +00:00
Nicholas Marriott 24d7d073ff Support the 47 and 1047 SM and RM sequences (alternate screen without
cursor), requested by I forget who ages ago.
2012-11-27 20:08:42 +00:00
Thomas Adam 39631edb98 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-11-27 18:12:04 +00:00
Nicholas Marriott 9b8998aeec Correctly aggregate together errors from nested config files (with
source-file). Fix by Thomas Adam, reported by Sam Livingstone-Gray
2012-11-27 16:12:29 +00:00