Commit Graph

325 Commits (603280cb286350c628ac2dfc06d5b8de135aa2af)

Author SHA1 Message Date
Thomas Adam 02e04477de Merge branch 'obsd-master'
Conflicts:
	server.c
2017-02-14 13:55:16 +00:00
nicm c6a3446398 Instead of numbering session groups, give them a name which may be given
to -t instead of a target session. Also allow them to contain only one
session.
2017-02-09 15:04:53 +00:00
Thomas Adam 780dd7ac82 Merge branch 'obsd-master' 2017-01-13 14:01:13 +00:00
nicm 22a528905d Make options_get_string return const string. 2017-01-13 11:56:43 +00:00
Thomas Adam d54e990c4f Merge branch 'obsd-master' 2016-10-17 00:01:11 +01:00
nicm 41e633acf5 Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.
2016-10-16 22:06:40 +00:00
Thomas Adam b9dc855016 Merge branch 'obsd-master'
Conflicts:
	format.c
	osdep-openbsd.c
2016-10-12 09:45:49 +01:00
nicm e45401846f Add static in window-*.c and move some internal functions out of tmux.h. 2016-10-11 13:21:59 +00:00
nicm c426e485e5 Loads more static, except for cmd-*.c and window-*.c. 2016-10-10 21:29:23 +00:00
Thomas Adam 93f42d360b Merge branch 'obsd-master' 2016-06-16 14:01:11 +01:00
nicm 325cbe90d9 Allow a command to be specified to display-panes, similar to
command-prompt, rather than always just selecting the pane.
2016-06-16 10:55:47 +00:00
Thomas Adam dc42c35f1f Merge branch 'obsd-master' 2016-01-19 18:01:15 +00:00
nicm 995af0e2b7 I no longer use my SourceForge address so replace it. 2016-01-19 15:59:12 +00:00
Thomas Adam e0cae08c04 Merge branch 'obsd-master' 2015-12-17 00:01:08 +00:00
nicm 021c64310d Add infrastructure to work out the best target given a pane or window
alone and use it to add pane_died and pane_exited hooks.
2015-12-16 21:50:37 +00:00
Thomas Adam 845a664bb2 Merge branch 'obsd-master' 2015-12-12 20:01:15 +00:00
nicm 5ed17e84fa Add key-table option to set the default key table for a session, allows
different key bindings for different sessions and a few other things.
2015-12-12 18:32:24 +00:00
Thomas Adam 4909a70174 Merge branch 'obsd-master' 2015-12-11 13:24:45 +00:00
nicm d7e11d0af7 Check alerts when session changes, from Patrick Palka. 2015-12-11 12:39:47 +00:00
Thomas Adam 890d8da2e3 Merge branch 'obsd-master'
Conflicts:
	log.c
	proc.c
	tmux.c
2015-11-25 16:37:30 +00:00
nicm 62d3af17f9 Make environ_set va_args and use it to tidy up some calls. Also add a
missing word in manpage (from jmc).
2015-11-24 23:46:15 +00:00
Thomas Adam 7fe8edc396 Merge branch 'obsd-master' 2015-11-18 16:01:23 +00:00
nicm 577c0e3e5a Use __unused rather than rolling our own. 2015-11-18 14:27:44 +00:00
Thomas Adam 7b749eff35 Merge branch 'obsd-master'
Conflicts:
	server.c
	tmux.c
2015-11-14 11:38:30 +00:00
nicm c56b81a2ce Push stdout and stderr to clients more aggressively, and add an event to
continue if the send fails.
2015-11-14 09:41:06 +00:00
Thomas Adam da1f6fc2c8 Merge branch 'obsd-master'
Conflicts:
	Makefile
	client.c
	server-client.c
	server.c
	tmux.c
	tmux.h
2015-10-27 23:27:26 +00:00
nicm 44657bf932 Move struct options into options.c. 2015-10-27 15:58:42 +00:00
nicm 07b0ea03c3 Break the common process set up, event loop and imsg dispatch code
between server and client out into a separate internal API. This will
make it easier to add another process.
2015-10-27 13:23:24 +00:00
Thomas Adam 1f4a5b5dfe Merge branch 'obsd-master' 2015-10-21 00:01:19 +01:00
nicm 076034345a Use client pointer not file descriptor in logging. 2015-10-20 21:12:08 +00:00
Thomas Adam 1fd756066c Merge branch 'obsd-master' 2015-09-10 12:01:08 +01:00
nicm cfabe30bec Add session_last_attached time and format, from Sina Siadat. 2015-09-10 08:58:14 +00:00
Thomas Adam 486421ceff Merge branch 'obsd-master' 2015-08-28 16:01:09 +01:00
Thomas Adam 84eabb2658 Merge branch 'obsd-master' 2015-08-28 14:01:11 +01:00
nicm 57cc4d45d5 Make session_update_activity more useful and use it in more places. 2015-08-28 13:01:03 +00:00
nicm 75d10058a4 Run status update on a per-client timer at status-interval. 2015-08-28 12:16:28 +00:00
Thomas Adam c0cf4843e5 Merge branch 'obsd-master' 2015-04-29 18:42:12 +01:00
nicm 7382ba82c5 If default-terminal is set to "screen" or "screen-*", emulate screen's
historical (incorrect) behaviour for SGR 3 and send smso
(standout). Previously, we would send sitm (italics) if the terminal
outside had it and smso otherwise. This was acceptably until recently
because xterm's terminfo entry lacked sitm, so most users got smso.

People who want italics should set default-terminal to the forthcoming
"tmux" entry (and be prepared to deal with it being missing on older
hosts).

As a side-effect this changes default-terminal to be a server rather
than a session option.

suggested by and ok naddy
2015-04-29 15:59:08 +00:00
Thomas Adam 56e1132db4 Merge branch 'obsd-master' 2015-04-25 10:02:46 +00:00
nicm aeedb464a6 Convert clients list into a TAILQ. 2015-04-24 23:17:11 +00:00
nicm 9a453dd354 Make session_has return a flag, returning the first winlink found is a
recipe for errors.
2015-04-22 15:32:33 +00:00
Thomas Adam 0a88377086 Merge branch 'obsd-master' 2015-04-22 10:05:54 +01:00
nicm 0e7219d437 Fix moving windows to nonexistent indexes when renumber-windows is
off. From Thomas Adam, reported by Daniel Levai and Theo Buehler.
2015-04-21 21:24:49 +00:00
Thomas Adam b25dc423b0 Merge branch 'obsd-master' 2015-04-20 15:44:27 +01:00
nicm bbac2aee1f Honour renumber-windows when unlinking a window, from Thomas Adam. 2015-04-19 21:46:52 +00:00
nicm bf635e7741 Rewrite of tmux mouse support which was a mess. Instead of having
options for "mouse-this" and "mouse-that", mouse events may be bound as
keys and there is one option "mouse" that turns on mouse support
entirely (set -g mouse on).

See the new MOUSE SUPPORT section of the man page for description of the
key names and new flags (-t= to specify the pane or window under mouse
as a target, and send-keys -M to pass through a mouse event).

The default builtin bindings for the mouse are:

    bind -n   MouseDown1Pane select-pane -t=; send-keys -M
    bind -n MouseDown1Status select-window -t=
    bind -n   MouseDrag1Pane copy-mode -M
    bind -n MouseDrag1Border resize-pane -M

To get the effect of turning mode-mouse off, do:

    unbind -n MouseDrag1Pane
    unbind -temacs-copy MouseDrag1Pane

The old mouse options are now gone, set-option -q may be used to
suppress warnings if mixing configuration files.
2015-04-19 21:34:21 +00:00
Thomas Adam 370cf75458 Merge branch 'obsd-master' 2015-04-19 14:44:56 +01:00
nicm 02df86079b Fix some format specifier nits, from Ben Boeckel. 2015-03-31 17:45:10 +00:00
Thomas Adam da72a0b7a8 Merge branch 'obsd-master' 2015-01-10 21:38:50 +00:00
nicm fee096a406 Unzoom before kill, from Thomas Adam. 2015-01-06 09:12:53 +00:00
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 900f6fc17e Tidy up some includes. 2014-10-20 23:27:14 +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
Nicholas Marriott 4273c1b80e Use utempter to update utmp if it's around for configure, from madmaverick9 at
roxxmail dot eu.
2014-02-24 23:07:22 +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
nicm 282c5f9644 Alter how tmux handles the working directory to internally use file
descriptors rather than strings.

- Each session still has a current working directory.

- New sessions still get their working directory from the client that
  created them or its attached session if any.

- New windows are created by default in the session working directory.

- The -c flag to new, neww, splitw allows the working directory to be
  overridden.

- The -c flag to attach let's the session working directory be changed.

- The default-path option has been removed.

To get the equivalent to default-path '.', do:

        bind c neww -c $PWD

To get the equivalent of default-path '~', do:

        bind c neww -c ~

This also changes the client identify protocol to be a set of messages rather
than one as well as some other changes that should make it easier to make
backwards-compatible protocol changes in future.
2013-10-10 12:26:34 +00:00
nicm 10c38436aa Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048. 2013-10-10 12:13:56 +00:00
nicm d3830e622f Grouped sessions were being leaked on destroy, correctly free them. 2013-10-10 11:46:28 +00:00
Nicholas Marriott 4538c269d0 Alter how tmux handles the working directory to internally use file descriptors
rather than strings.

- Each session still has a current working directory.

- New sessions still get their working directory from the client that created
  them or its attached session if any.

- New windows are created by default in the session working directory.

- The -c flag to new, neww, splitw allows the working directory to be
  overridden.

- The -c flag to attach let's the session working directory be changed.

- The default-path option has been removed.

To get the equivalent to default-path '.', do:

        bind c neww -c $PWD

To get the equivalent of default-path '', do:

        bind c neww -c '#{pane_current_path}'

The equivalent of default-path '~' is left as an exercise for the reader.

This also changes the client identify protocol to be a set of messages rather
than one as well as some other changes that should make it easier to make
backwards-compatible protocol changes in future.
2013-10-06 21:02:23 +01:00
Nicholas Marriott fa1375c09f Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048. 2013-10-06 00:48:24 +01:00
Nicholas Marriott f141e9b37a Instead of fixed size buffers for some messages, send only the string length. 2013-10-06 00:28:35 +01:00
Nicholas Marriott b0b5cad496 Grouped sessions were being leaked on destroy, correctly free them. 2013-08-01 23:38:35 +01:00
Thomas Adam bdea2f9eda Merge branch 'obsd-master' 2013-07-06 11:18:49 +01:00
Nicholas Marriott 064124cc5f When the session option renumber-window is used, ensure we iterate over
all sessions in that group when the winlinks are reordered, otherwise
the winlink lists are out of sync with one another. From Thomas Adam.
2013-07-05 14:52:33 +00:00
Thomas Adam cd60e57b6a Merge branch 'obsd-master'
Sync from OpenBSD.
2013-04-23 08:26:04 +01:00
Nicholas Marriott 46c7dbef0f Call recalculate_sizes() after killing window in case it is in a grouped
session, from Daniel Ralston.
2013-04-22 13:35:18 +00:00
Nicholas Marriott e4c0730bf1 Use single stdout and stderr for control clients. 2013-03-25 11:36:59 +00:00
Nicholas Marriott 6fee3e9e4b Rename session idx to session id throughout and add $ prefix to targets
to use it, extended from a diff from George Nachman.
2013-03-25 10:11:45 +00:00
Nicholas Marriott c71844de63 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-03-24 09:57:59 +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 29613f2f31 Prevent lock on control clients, not on others. 2013-03-22 10:42:55 +00:00
Nicholas Marriott 8d59b189cc No more lint means no more ARGSUSED. 2013-03-22 10:31:22 +00:00
Nicholas Marriott c5504af4a6 Add various checks to turn off bits that can't work in control mode
(such as lock).
2013-03-21 18:47:01 +00:00
Nicholas Marriott 412ac6bc3a Use single stdout and stderr for control clients. 2013-03-11 09:46:18 +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 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 8a7d463b87 Prevent lock on control clients, not on others. 2013-02-19 21:11:32 +00:00
Nicholas Marriott 9d165df18a No more lint means no more ARGSUSED. 2013-02-17 23:15:38 +00:00
Nicholas Marriott 3d9fd1c7f2 Add various checks to turn off bits that can't work in control mode (such as
lock).
2013-02-17 10:12:55 +00:00
Nicholas Marriott f536dc47c4 If stdin in the client is enable immediately, tmux will eat anything
sent to stdin before it is needed, which can be inconvenient (eg pasting
commands). Instead, start with stdin disabled and reuse MSG_STDIN from
server->client to mean that stdin should be enabled. Based on a diff
from Chris Johnsen.
2012-09-04 22:35:52 +01:00
Nicholas Marriott 2e43372d0b If stdin in the client is enable immediately, tmux will eat anything
sent to stdin before it is needed, which can be inconvenient (eg pasting
commands). Instead, start with stdin disabled and reuse MSG_STDIN from
server->client to mean that stdin should be enabled. Based on a diff
from Chris Johnsen.
2012-09-03 08:48:57 +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 df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Tiago Cunha 0159c74a32 Sync OpenBSD patchset 1138:
Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
2012-06-18 15:23:01 +00:00
Nicholas Marriott 2942eca895 Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
2012-06-18 13:16:42 +00:00
Tiago Cunha baafc17a1e Sync OpenBSD patchset 1118:
Add a helper function to send ready message.
2012-05-22 20:59:58 +00:00
Tiago Cunha ffab6dbc9a Sync OpenBSD patchset 1114:
Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.

The tty fd is still passed to the server as before.

This bumps the tmux protocol version so new clients and old servers are
incompatible.
2012-05-22 20:56:35 +00:00
Nicholas Marriott 682884edc5 Add a helper function to send ready message. 2012-05-22 10:56:48 +00:00
Nicholas Marriott 7a4679a17f Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.

The tty fd is still passed to the server as before.

This bumps the tmux protocol version so new clients and old servers are
incompatible.
2012-05-21 18:27:42 +00:00
Tiago Cunha b728970c65 Sync OpenBSD patchset 1104:
Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-05-03 17:51:04 +00:00
Nicholas Marriott a6c22d650b Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-04-29 17:20:01 +00:00
Tiago Cunha f41efd9d89 Sync OpenBSD patchset 1069:
Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-18 02:22:09 +00:00
Tiago Cunha 0987d55231 Sync OpenBSD patchset 1057:
Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
2012-03-18 01:59:34 +00:00
Nicholas Marriott 46210344a6 Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-17 22:35:09 +00:00
Nicholas Marriott d3c842d367 Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.
2012-03-17 18:24:07 +00:00
Tiago Cunha e23df3af5a Sync OpenBSD patchset 1014:
Call bufferevent_free before closing file descriptor associated with it
or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers
in a twist. From Dylan Alex Simon.
2012-01-29 12:53:33 +00:00