Commit Graph

411 Commits (76688d204071b76fd3388e46e944e4b917c09625)

Author SHA1 Message Date
Thomas Adam 76688d2040 Merge branch 'obsd-master'
Conflicts:
	cfg.c
	tmux.c
2015-09-06 20:47:50 +01:00
nicm 82326dcbe2 A couple of style nits. 2015-09-03 14:30:23 +00:00
nicm 952ba84611 Work out config file when needed not at startup. 2015-09-01 10:10:59 +00:00
nicm 6a539c00df Path from $TMUX does not need to be global anymore. 2015-08-30 22:56:36 +00:00
nicm c6e9160c67 Login shell can be a client flag, and move the exec code into client.c. 2015-08-30 22:40:25 +00:00
nicm dd92b6e83d Event base does not need to be global. 2015-08-30 22:19:07 +00:00
Thomas Adam cb89f2f2a1 Merge branch 'obsd-master'
Conflicts:
	Makefile
	format.c
2015-08-30 21:44:01 +01:00
nicm b87dc608d9 Some style nits and dead assignments. 2015-08-30 15:43:40 +00:00
Thomas Adam 18a64ad52d Merge branch 'obsd-master' 2015-07-20 18:01:10 +01:00
nicm 92af3766ec Add an option (history-file) for a file to save/restore command prompt
history, from Olof-Joachim Frahm.
2015-07-20 15:50:04 +00:00
Nicholas Marriott 73f9f0334c Check for flock in libbsd for AIX, and remove some getopt.h includes. From J
Raynor.
2015-07-13 14:19:50 +01:00
Thomas Adam 7acc4addb5 Merge branch 'obsd-master'
Conflicts:
	client.c
	tmux.1
	tmux.c
2015-06-07 23:42:25 +01:00
jmc dc0d34e137 tweak SYNOPSIS and usage(); 2015-06-04 20:34:22 +00:00
Thomas Adam 833fe5bdee Merge branch 'obsd-master'
Conflicts:
	cmd-pipe-pane.c
2015-02-06 19:07:43 +00:00
nicm d451502676 Make a tmux-%u directory under TMUX_TMPDIR, like TMPDIR. 2015-01-19 09:58:34 +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 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 48478ea0a9 Remove log_debug2 as well and simplify log.c. 2014-03-31 21:42:45 +00:00
Nicholas Marriott b1a87b2ee4 Remove log_debug2 as well and simplify log.c. 2014-03-07 16:05:29 +00:00
nicm 81db6bab91 Leftovers from removing 88 colour support, from Theo Buehler. 2014-02-16 12:45:17 +00:00
Thomas Adam 1721056f35 Remove references to 88colour support
Tmux doesn't directly support terminals with 88 colours directly anymore.
2014-02-05 10:51:25 +00:00
Thomas d02c4bda3a Merge branch 'obsd-master' 2014-01-20 10:48:12 +00:00
nicm 938768ed3d Do not attempt to read .tmux.conf if we can't figure out a home
directory, from Tiago Cunha.
2014-01-15 11:46:28 +00:00
nicm adc1f21eae Three small changes from Tiago Cunha:
- Check for truncation when copying path.
- Don't need to use a temporary buffer in screen_set_title.
- Include strerror in output when connecting to server fails.
2014-01-09 14:05:55 +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 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 eb26dbd072 Merge IDENTIFY_* flags with CLIENT_* flags. 2013-10-10 12:12:08 +00:00
nicm e4dc1568ce Don't treat TMUX_TMPDIR as a potential file
The point of setting TMUX_TMPDIR is to then make any labels from -L go
to that directory.  In the case of makesocketpath() with no TMUX_TMPDIR
set, would set both the path and the default socket to a file.  The
checking of the permissions on the file worked fine in that case, but
when TMUX_TMPDIR is set, won't work on a directory.

This fixes the problem by ensuring the check on the permissions is
performed on directories only.

By Thomas Adam.
2013-10-10 12:03:22 +00:00
Nicholas Marriott e9b09faab2 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-06 22:38:33 +01: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 01a4752503 Merge IDENTIFY_* flags with CLIENT_* flags. 2013-10-06 00:10:40 +01:00
nicm 9f330897a8 Fix previous not to leak fd on failure, whoops. 2013-10-05 10:40:49 +00:00
Nicholas Marriott 710eeb2a33 Fix previous not to lead fd on failure. 2013-10-05 11:40:47 +01:00
Nicholas Marriott d51b4f92d7 Use open(".")/fchdir() to save and restore current directory rather than
getcwd()/chdir().
2013-10-05 09:14:11 +01:00
nicm 3d8a8ea0c6 Use open(".")/fchdir() to save and restore current directory rather than
getcwd()/chdir().
2013-10-05 08:12:39 +00:00
Thomas bda970b3b1 Don't treat TMUX_TMPDIR as a potential file
The point of setting TMUX_TMPDIR is to then make any labels from -L go to
that directory.  In the case of makesocketpath() with no TMUX_TMPDIR set,
would set both the path and the default socket to a file.  The checking of
the permissions on the file worked fine in that case, but when TMUX_TMPDIR
is set, won't work on a directory.

This fixes the problem by ensuring the check on the permissions is performed
on directories only.
2013-09-30 15:26:32 +01:00
Nicholas Marriott e323101ede Rename global configuration define. 2013-04-24 10:01:32 +00:00
Nicholas Marriott 4f3c31a6b6 Use sysconfdir for the location of global tmux.conf (but default it to /etc),
based on changes from Dagobert Michelsen.
2013-04-24 10:57:03 +01:00
Nicholas Marriott a46ccbd883 -paths.h. Fixes Solaris, from Dagobert Michelsen. 2013-04-22 09:39:21 +01:00
Thomas Adam 2c4543b9e9 Add back missing -V flag
This went walkies from a previous git commit.
2013-04-14 18:07:08 +01:00
Thomas Adam b58bca9a72 Merge branch 'obsd-master'
Conflicts:
	tmux.c
2013-04-13 17:05:49 +01:00
Nicholas Marriott 7f9b225cc2 Call setlocale(LC_TIME) at startup. 2013-04-11 21:52:18 +00:00
Nicholas Marriott 7f63658709 Add TMUX_TMPDIR variable to put the socket directory outside
TMPDIR. From Ben Boeckel.
2013-03-27 11:24:18 +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 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 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 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