Commit Graph

223 Commits

Author SHA1 Message Date
Nicholas Marriott
cbd360b7dd Spaces to tabs. 2014-03-06 12:46:03 +00:00
Nicholas Marriott
b65c72c45c Restore SunOS fix, noticed by Greg Onufer. 2014-03-05 23:28:32 +00:00
Thomas Adam
ca1d78f523 Merge branch 'obsd-master' 2014-02-19 15:05:07 +00:00
nicm
69b7c496ac Be consistent and allow only mouse down and mouse wheel for any pane
with mouse-select-pane rather than just in copy mode, reported by Balazs
Kezes.
2014-02-17 22:42:20 +00:00
Thomas Adam
b3de4a3dec Merge branch 'obsd-master'
Conflicts:
	tmux.1
	tmux.c
2014-02-16 23:02:07 +00:00
nicm
e9d32f901a Make status-interval of zero work as indented. 2014-02-14 14:00:18 +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
9f02feb9d0 Break up and simplify screen_redraw_screen. 2014-01-31 14:19:24 +00:00
Thomas Adam
3e498cdb49 Merge branch 'obsd-master' 2013-11-14 07:51:26 +00:00
benno
7624800ddc from nicm: : handle msgbuf_write() returning EAGAIN 2013-11-13 20:43:36 +00:00
nicm
bf35441608 Do not run any command line command from the client which starts the
server until after the configuration file completes. This prevents it
racing against run-shell or if-shell in .tmux.conf that run in the
background.
2013-10-20 17:28:43 +00:00
Thomas
7f479ffdce Merge branch 'obsd-master' into mtemp 2013-10-11 14:33:29 +01:00
nicm
4901d9ddc8 Don't leak file descriptors in the rare MSG_VERSION case. From Chris
Johnsen.
2013-10-11 08:07:12 +00:00
nicm
c1ccefc62d We accidentally haven't been using $TMUX to work out the session for a
while and in fact it is less useful that using the client ttyname. So
don't bother and don't pass it from the client. If we need it in future
it is in c->environ.
2013-10-10 12:29:35 +00:00
nicm
b8b85fbb0c Don't look at string[length - 1] if length == 0. 2013-10-10 12:27:38 +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
47a4a9992c Allow the file descriptor received from the client to be -1. 2013-10-10 11:49:07 +00:00
Nicholas Marriott
e8567098a4 Add support for Cgywin, apparently it is enough just to open the tty again in
the server and fd passing is not necessary. Needs some ifdefs unfortunately but
no way around that and some of them can go next time we're willing to do a
protocol bump. Patch from J Raynor jxraynor at gmail dot com.
2013-07-12 22:21:42 +01:00
Nicholas Marriott
c7a121cfc0 Focus events can cause trouble if left on and they can't be turned off
during idle periods (like the other states are) because we'd miss
events. So add a server option to control them. Defaults to off.
2013-06-28 20:55:16 +01:00
Nicholas Marriott
3977dba761 Focus events can cause trouble if left on and they can't be turned off
during idle periods (like the other states are) because we'd miss
events. So add a server option to control them. Defaults to off.
2013-06-23 13:10:46 +00:00
Thomas Adam
cd60e57b6a Merge branch 'obsd-master'
Sync from OpenBSD.
2013-04-23 08:26:04 +01:00
Nicholas Marriott
5dda1abc32 Don't let server_client_check_focus use a dead bufferevent, from Romain
Francoise.
2013-04-21 21:32:00 +00:00
Thomas Adam
b58bca9a72 Merge branch 'obsd-master'
Conflicts:
	tmux.c
2013-04-13 17:05:49 +01:00
Nicholas Marriott
743bd1275f Need errno.h, reported by Swaroop M S. 2013-04-10 12:52:40 +01:00
Nicholas Marriott
69c86379e3 Remove some code not needed on OpenBSD. 2013-04-10 11:51:16 +00:00
Nicholas Marriott
982354765b Remove tmux's (already minimal) 88 colour support. Such terminals are
few and unnecessary.
2013-03-27 11:17:12 +00:00
Nicholas Marriott
673eb160d4 Sort includes and fix spaces. 2013-03-25 11:53:54 +00:00
Nicholas Marriott
e4c0730bf1 Use single stdout and stderr for control clients. 2013-03-25 11:36:59 +00:00
Nicholas Marriott
62db3c8efe Send DSC 1000p at the beginning of a -CC client's lifetime and ST and
the end, from George Nachman.
2013-03-25 10:03:24 +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
a60687f9ba Handle focus events from the terminal, from Aaron Jensen. 2013-03-24 09:28:59 +00:00
Nicholas Marriott
2243cfbe75 Need to set clients in context before changing their reference count. 2013-03-22 15:54:29 +00:00
Nicholas Marriott
a1722d5c2e Remove unnecessary initializers of cmd_ctx. 2013-03-22 15:50:42 +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
63b4fd5cac Add a format client_prefix which is 1 if prefix key has been
pressed, used for example #{?client_prefix,X,Y}. Also a few extra
server_client_status needed.
2013-03-21 16:14:09 +00:00
Nicholas Marriott
412ac6bc3a Use single stdout and stderr for control clients. 2013-03-11 09:46:18 +00:00
Nicholas Marriott
208881a735 Send DSC 1000p at the beginning of a -CC client's lifetime and ST and the end,
from George Nachman..
2013-03-04 08:52:41 +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
dbd8e47846 Do pane resize ioctls once at the end of the server loop rather than
immediately.
2013-02-22 21:35:29 +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
afd5e978cf Need to set clients in context before changing their reference count. 2013-02-20 10:25:15 +00:00
Nicholas Marriott
693244795c Remove unnecessary initializers of cmd_ctx. 2013-02-18 23:38:57 +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
9d165df18a No more lint means no more ARGSUSED. 2013-02-17 23:15:38 +00:00