OpenBSD CVS

CVS log for src/usr.bin/tmux/client.c


[BACK] Up to [local] / src / usr.bin / tmux

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.162 / (download) - annotate - [select for diffs], Wed May 15 09:59:12 2024 UTC (3 days, 22 hours ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.161: +3 -13 lines
Diff to previous 1.161 (colored)

Use default-shell for command prompt #() and popups as well

Revision 1.161 / (download) - annotate - [select for diffs], Mon Jul 10 12:00:08 2023 UTC (10 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.160: +1 -4 lines
Diff to previous 1.160 (colored)

It should no longer be necessary to ignore SIGCHLD because it is now
blocked around daemon(), and doing so causes trouble with newer libevent
(it cannot restore the original handler). Reported by Azat Khuzhin in
GitHub issue 3626.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Jul 10 09:35:46 2023 UTC (10 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.159: +15 -4 lines
Diff to previous 1.159 (colored)

Loop around waitpid in client, from Azat Khuzhin.

Revision 1.159 / (download) - annotate - [select for diffs], Fri Jan 6 07:09:27 2023 UTC (16 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.158: +4 -1 lines
Diff to previous 1.158 (colored)

If a pane is killed, cancel reading from the file. GitHub issue 3422.

Revision 1.158 / (download) - annotate - [select for diffs], Mon May 30 12:48:57 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.157: +2 -1 lines
Diff to previous 1.157 (colored)

Add an ACL list for users connecting to the tmux socket. Users may be
forbidden from attaching, forced to attach read-only, or allowed to
attach read-write. A new command, server-access, configures the list.
tmux gets the user using getpeereid(3) of the client socket. Users must
still configure file system permissions manually. From Dallas Lyons and
others.

Revision 1.157 / (download) - annotate - [select for diffs], Mon Feb 28 09:34:57 2022 UTC (2 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.156: +2 -2 lines
Diff to previous 1.156 (colored)

Exit on SIGHUP before attach also, GitHub issue 3084.

Revision 1.156 / (download) - annotate - [select for diffs], Fri Aug 27 17:25:55 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.155: +9 -5 lines
Diff to previous 1.155 (colored)

Replace %% in command lists (by copying them) for template arguments ,
this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.

Revision 1.155 / (download) - annotate - [select for diffs], Wed Feb 17 07:18:36 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.154: +34 -14 lines
Diff to previous 1.154 (colored)

Move the call to setupterm() into the client and have it pass the
results to the server over imsg, means the server does not need to enter
ncurses or read terminfo db. Old clients will not work with a new
server.

Revision 1.154 / (download) - annotate - [select for diffs], Fri Feb 12 06:52:48 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.153: +5 -3 lines
Diff to previous 1.153 (colored)

Do not care about the server socket closing if exiting anyway.

Revision 1.153 / (download) - annotate - [select for diffs], Thu Feb 11 09:39:29 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.152: +2 -15 lines
Diff to previous 1.152 (colored)

Add a couple of helper functions, and flush imsgs on exit.

Revision 1.152 / (download) - annotate - [select for diffs], Thu Feb 11 08:28:45 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.151: +19 -256 lines
Diff to previous 1.151 (colored)

Move file handling protocol stuff all into file.c so it can be reused
more easily.

Revision 1.151 / (download) - annotate - [select for diffs], Sun Jan 17 16:17:41 2021 UTC (3 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.150: +3 -1 lines
Diff to previous 1.150 (colored)

Add -N flag to never start server even if command would normally do so,
GitHub issue 2523.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Oct 30 18:54:23 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.149: +8 -3 lines
Diff to previous 1.149 (colored)

With csh, a tmux client gets SIGTERM before SIGCONT when killed with
"kill %%", so when the client tells the server it got SIGCONT, don't use
bits that may already have been freed when it got SIGTERM. Also don't
print anything on exit if we get SIGTERM while suspended. Reported by
Theo.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Sep 22 05:23:34 2020 UTC (3 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.148: +13 -7 lines
Diff to previous 1.148 (colored)

Fix warnings on some platforms with %llx and add a new message to handle
64-bit client flags.

Revision 1.148 / (download) - annotate - [select for diffs], Thu Jun 18 08:34:22 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.147: +34 -6 lines
Diff to previous 1.147 (colored)

Add a flag to make a client wait for an empty line before exiting in
control mode to avoid stray commands ending up in the shell.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Jun 10 07:27:10 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.146: +35 -12 lines
Diff to previous 1.146 (colored)

Instead of a buffer size limit on each pane, set a limit of 300 seconds
of data for each client in control mode.

Revision 1.146 / (download) - annotate - [select for diffs], Mon Jun 1 09:43:00 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.145: +11 -7 lines
Diff to previous 1.145 (colored)

Instead of sending all data to control mode clients as fast as possible,
add a limit of how much data will be sent to the client and try to use
it for panes with some degree of fairness. GitHub issue 2217, with
George Nachman.

Revision 1.145 / (download) - annotate - [select for diffs], Tue May 26 08:41:47 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.144: +6 -1 lines
Diff to previous 1.144 (colored)

Pass the stdout file descriptor from the client as well as stdin and use
them for control clients directly instead of passing everything via the
client.

Revision 1.144 / (download) - annotate - [select for diffs], Fri May 8 14:15:11 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.143: +2 -1 lines
Diff to previous 1.143 (colored)

imsg.h needs uio.h, pointed out by deraadt

Revision 1.143 / (download) - annotate - [select for diffs], Mon Apr 27 08:35:09 2020 UTC (4 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.142: +4 -3 lines
Diff to previous 1.142 (colored)

Do not close the stdout file descriptor in control mode as it will be
needed for printing the exit messages. Fixes a bug when detaching with
iTerm2.

Revision 1.142 / (download) - annotate - [select for diffs], Mon Apr 20 13:25:36 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.141: +6 -5 lines
Diff to previous 1.141 (colored)

Tidy up the terminal detection and feature code and add named sets of
terminal features, each of which are defined in one place and map to a
builtin set of terminfo(5) capabilities. Features can be specified based
on TERM with a new terminal-features option or with the -T flag when
running tmux. tmux will also detect a few common terminals from the DA
and DSR responses.

This is intended to make it easier to configure tmux's use of
terminfo(5) even in the presence of outdated ncurses(3) or terminfo(5)
databases or for features which do not yet have a terminfo(5) entry.
Instead of having to grok terminfo(5) capability names and what they
should be set to in the terminal-overrides option, the user can
hopefully just give tmux a feature name and let it do the right thing.

The terminal-overrides option remains both for backwards compatibility
and to allow tweaks of individual capabilities.

tmux already did much of this already, this makes it tidier and simpler
to configure.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Apr 13 08:26:27 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.140: +3 -6 lines
Diff to previous 1.140 (colored)

Make struct cmd local to cmd.c and move it out of tmux.h.

Revision 1.140 / (download) - annotate - [select for diffs], Thu Apr 9 13:52:32 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.139: +2 -2 lines
Diff to previous 1.139 (colored)

Some unnecessary assignments and unused variables.

Revision 1.139 / (download) - annotate - [select for diffs], Mon Mar 30 15:49:23 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

Add to rather than replace flags with -c.

Revision 1.138 / (download) - annotate - [select for diffs], Thu Mar 12 09:26:34 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.137: +12 -13 lines
Diff to previous 1.137 (colored)

When the server socket is given by the user with -S, create it with
umask 177 instead of 117 because it may not be in a safe directory like
the default directory in /tmp. The user can chmod it more open after it
is created if they want.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Jan 29 16:22:32 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.136: +7 -1 lines
Diff to previous 1.136 (colored)

Warn if a message type that is no longer used is received.

Revision 1.136 / (download) - annotate - [select for diffs], Mon Dec 16 16:09:28 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored)

Need to include message size in the maximum buffer calculation.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Dec 16 15:48:50 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.134: +32 -18 lines
Diff to previous 1.134 (colored)

Instead of using large buffers in imsgs, add the data or path onto the end.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Dec 13 07:00:22 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.133: +4 -1 lines
Diff to previous 1.133 (colored)

Need to check in the error callback also.

Revision 1.133 / (download) - annotate - [select for diffs], Fri Dec 13 06:55:12 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.132: +28 -25 lines
Diff to previous 1.132 (colored)

Do not spin waiting for exit, instead check in the write callback.

Revision 1.132 / (download) - annotate - [select for diffs], Thu Dec 12 11:39:56 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.131: +268 -64 lines
Diff to previous 1.131 (colored)

Rewrite the code for reading and writing files. Now, if the client is
not attached, the server process asks it to open the file, similar to
how works for stdin, stdout, stderr. This makes special files like
/dev/fd/X work (used by some shells). stdin, stdout and stderr and
control mode are now just special cases of the same mechanism. This will
also make it easier to use for other commands that read files such as
source-file.

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jul 26 20:08:40 2019 UTC (4 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

Change "lost server" message to "server exited unexpectedly", from Neal
McBurnett in GitHub issue 1857.

Revision 1.130 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:05 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.129: +2 -2 lines
Diff to previous 1.129 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.129 / (download) - annotate - [select for diffs], Sat May 25 07:18:20 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.128: +8 -8 lines
Diff to previous 1.128 (colored)

Merge cmd_list_parse into cmd-parse.y so it can use the new alias
processing code.

Revision 1.128 / (download) - annotate - [select for diffs], Thu Nov 22 10:36:40 2018 UTC (5 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.127: +3 -5 lines
Diff to previous 1.127 (colored)

Do not use PWD unless it actually matches the real working directory.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Apr 26 12:42:51 2018 UTC (6 years ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.126: +1 -3 lines
Diff to previous 1.126 (colored)

Use <fcntl.h> instead of <sys/file.h> for open() and friends.
Delete a bunch of unnecessary #includes and sort to match style(9)
while doing the above cleanup.

ok deraadt@ krw@

Revision 1.126 / (download) - annotate - [select for diffs], Mon Jan 1 11:19:08 2018 UTC (6 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.125: +5 -5 lines
Diff to previous 1.125 (colored)

Prefer PWD for current directory if present in client, from Wei Zhao in
GitHub issue 1183.

Revision 1.125 / (download) - annotate - [select for diffs], Tue Dec 19 15:00:39 2017 UTC (6 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored)

Report better error from server when socket create fails, GitHub issue
1201.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Dec 18 22:13:36 2017 UTC (6 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.123: +5 -1 lines
Diff to previous 1.123 (colored)

Do not try to put more in command message than will fit when sending
(the server will treat as a fatal error). GitHub issue 1200.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Jul 14 18:49:07 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.122: +3 -3 lines
Diff to previous 1.122 (colored)

Because ignore SIGCHLD early, letting signal_del restore it doesn't work
correctly, so set it explicitly back to default (and the others for good
measure).

Revision 1.122 / (download) - annotate - [select for diffs], Wed Jul 12 09:24:17 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.121: +6 -5 lines
Diff to previous 1.121 (colored)

Move signal code into proc.c.

Revision 1.121 / (download) - annotate - [select for diffs], Wed Jul 12 09:21:25 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.120: +9 -11 lines
Diff to previous 1.120 (colored)

Make shell_command a global like other stuff rather than making it an
exception and using callback argument.

Revision 1.120 / (download) - annotate - [select for diffs], Tue Jan 24 19:53:37 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.119: +7 -10 lines
Diff to previous 1.119 (colored)

Add support for custom command aliases, this is an array option which
contains items of the form "alias=command". This is consulted when an
unknown command is parsed.

Revision 1.119 / (download) - annotate - [select for diffs], Mon Jan 23 10:09:43 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.118: +3 -1 lines
Diff to previous 1.118 (colored)

Open /dev/ptm before pledge() and save it to be used for PTMGET later
(this means inlining forkpty()).

ok deraadt

Revision 1.118 / (download) - annotate - [select for diffs], Fri Jan 20 14:02:33 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.117: +6 -3 lines
Diff to previous 1.117 (colored)

Print error rather than fatal() if tcgetattr() fails, which is much more
useful to user.

Revision 1.117 / (download) - annotate - [select for diffs], Mon Jan 16 14:52:25 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.116: +9 -6 lines
Diff to previous 1.116 (colored)

Revert WIP parts of previous I didn't mean to commit yet.

Revision 1.116 / (download) - annotate - [select for diffs], Mon Jan 16 14:49:14 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.115: +7 -10 lines
Diff to previous 1.115 (colored)

getopt() has a struct option so just return to using options_entry.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Jan 13 10:12:12 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.114: +21 -1 lines
Diff to previous 1.114 (colored)

Add -E to detach-client to exec a command to replace the client instead
of exiting it, useful if tmux wasn't exec'd itself. From Jenna Magius.

Revision 1.114 / (download) - annotate - [select for diffs], Mon Oct 3 22:52:11 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.113: +32 -32 lines
Diff to previous 1.113 (colored)

Remove some dead code in cmd-move-window.c and make a load of local
functions static.

Revision 1.113 / (download) - annotate - [select for diffs], Tue Jan 19 15:59:12 2016 UTC (8 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Nov 25 07:58:55 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored)

Don't print error if none to print.

Revision 1.111 / (download) - annotate - [select for diffs], Tue Nov 24 23:22:51 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.110: +15 -13 lines
Diff to previous 1.110 (colored)

Shell command from -c doesn't have to be global, pass it as an argument.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Nov 24 23:01:51 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.109: +18 -16 lines
Diff to previous 1.109 (colored)

Do lock failures slightly better, return a special value so we don't
unlink the wrong thing.

Revision 1.109 / (download) - annotate - [select for diffs], Tue Nov 24 22:45:44 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.108: +19 -10 lines
Diff to previous 1.108 (colored)

Actually show something (even if it not that helpful) if the server
fails to start (for example if it can't create the socket), rather than
hanging or showing nothing.

Revision 1.108 / (download) - annotate - [select for diffs], Tue Nov 24 22:27:22 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

Tidy the code that works out the socket path, and just use the full path
in the global socket_path rather than copying it.

Revision 1.107 / (download) - annotate - [select for diffs], Tue Nov 24 22:04:36 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.106: +8 -9 lines
Diff to previous 1.106 (colored)

Switch a fprintf to a fatal, and wrap some long lines.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Nov 18 14:27:44 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.105: +4 -3 lines
Diff to previous 1.105 (colored)

Use __unused rather than rolling our own.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Nov 15 14:32:48 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

Accidentally turned off pledge, turn it back on.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Nov 14 09:41:06 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored)

Push stdout and stderr to clients more aggressively, and add an event to
continue if the send fails.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Oct 31 13:43:38 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

Don't shift version out of peerid, it is needed later.

Revision 1.102 / (download) - annotate - [select for diffs], Sat Oct 31 08:13:58 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.101: +5 -3 lines
Diff to previous 1.101 (colored)

Because pledge(2) does not allow us to pass directory file descriptors
around, we can't use file descriptors for the working directory because
we will be unable to pass it to a privileged process to tell it where to
read or write files or spawn children. So move tmux back to using
strings for the current working directory. We try to check it exists
with access() when it is set but ultimately fall back to ~ if it fails
at time of use (or / if that fails too).

Revision 1.101 / (download) - annotate - [select for diffs], Wed Oct 28 09:51:55 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored)

Like options, move the environ struct into environ.c.

Revision 1.100 / (download) - annotate - [select for diffs], Tue Oct 27 15:58:42 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored)

Move struct options into options.c.

Revision 1.99 / (download) - annotate - [select for diffs], Tue Oct 27 13:23:24 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.98: +209 -302 lines
Diff to previous 1.98 (colored)

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.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Oct 18 20:42:42 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.97: +10 -10 lines
Diff to previous 1.97 (colored)

Pass current directory as a string rather than a file descriptor because
pledge doesn't let us pass directory file descriptors.

Revision 1.97 / (download) - annotate - [select for diffs], Sat Oct 17 18:30:43 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.96: +41 -14 lines
Diff to previous 1.96 (colored)

Add pledge "stdio unix sendfd proc exec tty" to tmux client process,
"sendfd" is dropped after first message from the server.

Revision 1.96 / (download) - annotate - [select for diffs], Sun Oct 11 00:26:23 2015 UTC (8 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

Userspace doesn't need to use SUN_LEN(): connect() and bind() must accept
sizeof(struct sockaddr_un), so do the simple, portable thing

ok beck@ deraadt@

Revision 1.95 / (download) - annotate - [select for diffs], Thu Sep 24 12:06:20 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.94: +6 -2 lines
Diff to previous 1.94 (colored)

Don't leak fd and path on failure.

Revision 1.94 / (download) - annotate - [select for diffs], Wed Sep 9 12:09:21 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.93: +5 -1 lines
Diff to previous 1.93 (colored)

No need to keep global options around for client which doesn't use them.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Aug 30 22:40:25 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.92: +51 -18 lines
Diff to previous 1.92 (colored)

Login shell can be a client flag, and move the exec code into client.c.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Aug 30 22:19:07 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.91: +6 -6 lines
Diff to previous 1.91 (colored)

Event base does not need to be global.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Jul 13 18:10:26 2015 UTC (8 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.90: +7 -3 lines
Diff to previous 1.90 (colored)

Ignore environment variables that are too long to send to the server.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jun 14 10:07:44 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.89: +7 -3 lines
Diff to previous 1.89 (colored)

Add a format for client PID (client_pid) and server PID (pid). Diff for
client_pid from Thomas Adam.

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jun 4 23:27:51 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.88: +2 -16 lines
Diff to previous 1.88 (colored)

Move the nested check from client to server and compare the client tty
name to all the pane pty names instead of comparing socket paths. This
means that "new -d" will work without unsetting $TMUX.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Apr 24 20:58:44 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.87: +4 -4 lines
Diff to previous 1.87 (colored)

Set up signal handler earlier so that we don't get zombies, reported by
sobrado@.

Revision 1.87 / (download) - annotate - [select for diffs], Tue Apr 21 22:21:41 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.86: +8 -3 lines
Diff to previous 1.86 (colored)

Simplify error messages when socket connect fails, suggested by "Karthik K".

Revision 1.86 / (download) - annotate - [select for diffs], Tue Mar 31 17:45:10 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.85: +4 -4 lines
Diff to previous 1.85 (colored)

Fix some format specifier nits, from Ben Boeckel.

Revision 1.85 / (download) - annotate - [select for diffs], Mon Oct 20 23:27:14 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.84: +2 -1 lines
Diff to previous 1.84 (colored)

Tidy up some includes.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Oct 1 23:23:19 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.83: +5 -9 lines
Diff to previous 1.83 (colored)

Call waitpid on SIGCHLD even if client not attached, it is possible (on
very slow platforms) for the first daemon() child to still be running
when client_attached is set so we end up with a zombie. From J Raynor.

Revision 1.83 / (download) - annotate - [select for diffs], Mon Sep 1 21:50:18 2014 UTC (9 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored)

Various minor style and spacing nits.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Jul 21 10:52:48 2014 UTC (9 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.81: +37 -13 lines
Diff to previous 1.81 (colored)

lockf is entirely useless and it was a mistake to change to it, go back
to using flock which actually works sensibly. Also always retry the lock
to fix a potential race, and add some extra logging.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Jul 13 20:51:08 2014 UTC (9 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

An EOF is a good reason to close a connection.

ok nicm@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Apr 29 22:31:22 2014 UTC (10 years ago) by nicm
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

fcntl.h is still needed here.

Revision 1.79 / (download) - annotate - [select for diffs], Thu Apr 17 11:38:35 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.78: +1 -3 lines
Diff to previous 1.78 (colored)

Remove some unnecessary includes and fix a typo.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Jan 9 21:20:45 2014 UTC (10 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.77: +8 -3 lines
Diff to previous 1.77 (colored)

Fix a memory/fd leak reported by Tiago Cunha.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Jan 9 14:05:55 2014 UTC (10 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (colored)

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.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Nov 13 20:43:36 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

from nicm: : handle msgbuf_write() returning EAGAIN

Revision 1.75 / (download) - annotate - [select for diffs], Thu Oct 10 12:35:30 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

Use format_get_command() and some spacing tweaks.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Oct 10 12:29:35 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.73: +1 -5 lines
Diff to previous 1.73 (colored)

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.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Oct 10 12:28:08 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.72: +19 -4 lines
Diff to previous 1.72 (colored)

Show session name in detached message. Requested by somebody a few
months ago who didn't bother testing it. But it works for me anyway.

Revision 1.72 / (download) - annotate - [select for diffs], Thu Oct 10 12:27:38 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored)

Don't look at string[length - 1] if length == 0.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Oct 10 12:26:34 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.70: +25 -37 lines
Diff to previous 1.70 (colored)

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.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Oct 10 12:13:56 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.69: +50 -16 lines
Diff to previous 1.69 (colored)

Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048.

Revision 1.69 / (download) - annotate - [select for diffs], Thu Oct 10 12:13:29 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.68: +32 -36 lines
Diff to previous 1.68 (colored)

Instead of fixed size buffers for some messages, send only the string
length.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Oct 10 12:12:08 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.67: +8 -10 lines
Diff to previous 1.67 (colored)

Merge IDENTIFY_* flags with CLIENT_* flags.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Oct 10 12:09:34 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.66: +3 -6 lines
Diff to previous 1.66 (colored)

Remove CMD_SENDENVIRON.

Revision 1.66 / (download) - annotate - [select for diffs], Mon Apr 22 08:42:19 2013 UTC (11 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (colored)

Use lockf which is more portable than flock, from Dagobert Michelsen.

Revision 1.65 / (download) - annotate - [select for diffs], Mon Mar 25 11:38:57 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

We ignore SIGWINCH until ready, so send a MSG_RESIZE immediately when
becoming ready.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Mar 25 10:11:45 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Rename session idx to session id throughout and add $ prefix to targets
to use it, extended from a diff from George Nachman.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Mar 25 10:03:24 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.62: +10 -2 lines
Diff to previous 1.62 (colored)

Send DSC 1000p at the beginning of a -CC client's lifetime and ST and
the end, from George Nachman.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Mar 24 09:54:10 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.61: +3 -2 lines
Diff to previous 1.61 (colored)

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.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Mar 22 10:31:22 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.60: +1 -5 lines
Diff to previous 1.60 (colored)

No more lint means no more ARGSUSED.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Sep 3 08:48:57 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.59: +7 -2 lines
Diff to previous 1.59 (colored)

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.

Revision 1.59 / (download) - annotate - [select for diffs], Mon Aug 27 21:35:11 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

Change a log to fprintf that was missed last time around, from Tiago Cunha.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

xfree is not particularly helpful, remove it. From Thomas Adam.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Jun 18 13:34:56 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.56: +22 -3 lines
Diff to previous 1.56 (colored)

Actually write all the data to stdout/stderr.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Jun 18 13:16:42 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.55: +27 -2 lines
Diff to previous 1.55 (colored)

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.

Revision 1.55 / (download) - annotate - [select for diffs], Fri May 25 08:28:10 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.54: +6 -6 lines
Diff to previous 1.54 (colored)

Simplify logging and just fprintf(stderr, ...) for early errors.

Revision 1.54 / (download) - annotate - [select for diffs], Mon May 21 18:27:42 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.53: +50 -16 lines
Diff to previous 1.53 (colored)

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.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Apr 23 23:25:02 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored)

Add missing prototype.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Apr 23 23:18:43 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.51: +47 -12 lines
Diff to previous 1.51 (colored)

Use an enum for client exit reasons, from George Nachman.

Revision 1.51 / (download) - annotate - [select for diffs], Sat Mar 24 11:23:19 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored)

Add sys/file.h.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Mar 19 08:42:06 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.49: +6 -6 lines
Diff to previous 1.49 (colored)

Move MSG_IDENTIFY to the last sent by the client, this will be needed by
control clients and irrelevant for others.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Mar 9 09:57:40 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.48: +41 -14 lines
Diff to previous 1.48 (colored)

Use a lock file and flock() to serialize server start, avoids problems
when running a bunch of tmux from cron at the same time. Based on a diff
from Tim Ruehsen.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 3 08:51:47 2011 UTC (13 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.47: +17 -4 lines
Diff to previous 1.47 (colored)

Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jan 8 01:52:36 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.46: +3 -6 lines
Diff to previous 1.46 (colored)

Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").

Revision 1.46 / (download) - annotate - [select for diffs], Mon Oct 18 20:00:02 2010 UTC (13 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.45: +244 -95 lines
Diff to previous 1.45 (colored)

Merge the before and after attach client code into one in client.c
(instead of two in tmux.c and client.c).

Revision 1.45 / (download) - annotate - [select for diffs], Sat Oct 16 08:31:55 2010 UTC (13 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.44: +1 -3 lines
Diff to previous 1.44 (colored)

Trying to set FD_CLOEXEC on every fd is a lost cause, just use
closefrom() before exec.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Aug 23 17:36:32 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

Can't call event_del() without event_set() first - so call event_set()
when setting up the client.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Aug 22 16:09:49 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

MSG_EXIT can now have a return code in the message, so check for that
size as well. Stops the client fatal()ing on exit.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jun 28 22:10:42 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.41: +10 -3 lines
Diff to previous 1.41 (colored)

Send all three of stdin, stdout, stderr from the client to the server, so that
commands can directly make use of them. This means that load-buffer and
save-buffer can have "-" as the file to read from stdin or write to stdout.

This is a protocol version bump so the tmux server will need to be restarted
after upgrade (or an older client used).

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jun 5 16:47:11 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.40: +8 -1 lines
Diff to previous 1.40 (colored)

Fix problems with window sizing seen by Raghavendra D Prabhu when
starting tmux from .xinitrc.

One of the very few things the server relies on the client for now is to
pass through a message on SIGWINCH, but there is a condition where
potentially a SIGWINCH may be lost during the transition from unattached
(main.c) to attached (client.c). So trigger a size change immediately
after the client installs its SIGWINCH handler.

Also, when the terminal is resized, reset the scroll region and cursor
position. Previously, we were clearing our saved idea of these, but in
fact some terminals do not reset them on resize, so this caused problems
during redraw.

While here make a resize to the same size not cause a redraw and rename
the tmux.out output log file to include the tmux PID.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Jun 5 16:29:45 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.39: +1 -5 lines
Diff to previous 1.39 (colored)

This ioctl(TIOCGWINSZ) call is no longer necessary, the result is never
used and the server now does it later on the tty fd directly.

Revision 1.39 / (download) - annotate - [select for diffs], Wed May 12 15:05:39 2010 UTC (14 years ago) by jsing
Branch: MAIN
Changes since 1.38: +5 -0 lines
Diff to previous 1.38 (colored)

Catch SIGHUP and terminate if running as a client. This prevents clients
from being left hanging around when, for example, a SSH session is
disconnected.

ok nicm@

Revision 1.38 / (download) - annotate - [select for diffs], Tue May 4 17:28:16 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.37: +2 -25 lines
Diff to previous 1.37 (colored)

Put this back in with the initialisation in the right order.

Revision 1.37 / (download) - annotate - [select for diffs], Tue May 4 08:48:06 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.36: +24 -1 lines
Diff to previous 1.36 (colored)

Revert last change, it appears to be broken somehow.

Revision 1.36 / (download) - annotate - [select for diffs], Mon May 3 16:06:32 2010 UTC (14 years ago) by nicm
Branch: MAIN
Changes since 1.35: +2 -25 lines
Diff to previous 1.35 (colored)

Make signal handler setup/teardown two common functions instead of six,
and reset SIGCHLD after fork to fix problems with some shells. From
Romain Francois.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Dec 3 22:50:09 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.34: +8 -8 lines
Diff to previous 1.34 (colored)

Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...

Revision 1.34 / (download) - annotate - [select for diffs], Thu Nov 26 21:37:13 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.33: +3 -1 lines
Diff to previous 1.33 (colored)

Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Nov 13 18:07:52 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

imsg_read returns ssize_t not int, pointed out by lint via deraadt.

Revision 1.32 / (download) - annotate - [select for diffs], Tue Nov 10 15:47:48 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.31: +9 -8 lines
Diff to previous 1.31 (colored)

Don't return 1 unless there was actually a problem (signal/lost server) rather
than for all events (normal exit/detach/etc).

Revision 1.31 / (download) - annotate - [select for diffs], Wed Nov 4 22:57:49 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.30: +20 -23 lines
Diff to previous 1.30 (colored)

Move some common code into a function.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Nov 4 20:50:11 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.29: +125 -91 lines
Diff to previous 1.29 (colored)

Initial changes to move tmux to libevent.

This moves the client-side loops are pretty much fully over to event-based only
(tmux.c and client.c) but server-side (server.c and friends) treats libevent as
a sort of clever poll, waking up after every event to run various things.

Moving the server stuff over to bufferevents and timers and so on will come
later.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Nov 2 13:42:25 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.28: +1 -2 lines
Diff to previous 1.28 (colored)

Leftover unused variable :-/.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Nov 2 13:41:25 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.27: +8 -16 lines
Diff to previous 1.27 (colored)

There isn't much point in doing lstat before connect so instead just do connect
and handle ENOENT from it which is a little tidier.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Oct 26 21:38:18 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.26: +7 -4 lines
Diff to previous 1.26 (colored)

Clear signal flags /before/ taking action and continue afterwards to reduce
chance of dropping signals. Pointed out by deraadt@.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Oct 21 21:11:55 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.25: +36 -30 lines
Diff to previous 1.25 (colored)

Tidy identify message send into a separate function.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Oct 21 20:11:47 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.24: +74 -76 lines
Diff to previous 1.24 (colored)

Client tidying: get rid of client_ctx struct in favour of two variables in
client.c, and move the functions in client-fn.c into other files.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Oct 13 13:15:26 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.23: +24 -23 lines
Diff to previous 1.23 (colored)

Do this in a better way - print messages when exiting with nonzero.

Also remove the login shell information from server-info, only the client
should care about it.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 13 13:11:06 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.22: +29 -23 lines
Diff to previous 1.22 (colored)

Don't print exit messages when used as a login shell, requested by martynas@ a
while back.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Sep 23 12:03:30 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

Support -c like sh(1) to execute a command, useful when tmux is a login
shell. Suggested by halex@.

This includes another protocol version increase (the last for now) so again
restart the tmux server before upgrading.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Sep 23 06:18:47 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.20: +11 -1 lines
Diff to previous 1.20 (colored)

Remove the internal tmux locking and instead detach each client and run the
command specified by a new option "lock-command" (by default "lock -np") in
each client.

This means each terminal has to be unlocked individually but simplifies the
code and allows the system password to be used to unlock.

Note that the set-password command is gone, so it will need to be removed from
configuration files, and the -U command line flag has been removed.

This is the third protocol version change so again it is best to stop the tmux
server before upgrading.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Sep 23 06:12:58 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.19: +5 -22 lines
Diff to previous 1.19 (colored)

Trim some code by moving the ioctl(TIOCGWINSZ) after SIGWINCH from the client
into the server.

This is another (the second of four) protocol version changes coming this
morning, so again the server should be killed before upgrading.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Sep 23 06:05:02 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.18: +4 -9 lines
Diff to previous 1.18 (colored)

Don't attempt to open() the tty path, rely on the client sending its stdin fd
with imsg and fatal if it doesn't, then set the FD_CLOEXEC flag in tty_init
instead of tty_open to prevent them leaking into child processes if any are
created between the two calls.

This bumps the protocol version, so the tmux server should be killed before
upgrading.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Sep 20 14:58:12 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Regularise some fatal messages.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Sep 2 23:49:25 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.16: +17 -8 lines
Diff to previous 1.16 (colored)

Fix a race condition when asking a client to take over the terminal (switching
to a different poll loop):

If a MSG_READY was followed very quickly by a MSG_EXIT (for example if doing
"tmux new 'exit'"), both messages could be read as part of the same imsg_read
in the first client poll loop. The MSG_READY would then cause a switch to the
second client loop, which would immediately call poll(2) again, causing the
client to hang forever waiting for an exit message that it already had.

Change to call imsg_get to process any existing messages before polling.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Sep 2 20:15:49 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.15: +7 -6 lines
Diff to previous 1.15 (colored)

That was the wrong fix. MSG_ERROR should set the error and the client should
use the error and exit on MSG_EXIT (it was being handled in the default
case). Undo the last change, move the errstr check into the MSG_EXIT case, and
add a comment.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Sep 2 20:00:10 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.14: +7 -3 lines
Diff to previous 1.14 (colored)

Set exittype for error exit as well as the error string.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Aug 12 06:04:28 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (colored)

imsg closes the fd after sending, so dup() STDIN_FILENO before passing it to
the parent, otherwise TIOCGWINSZ will fail when the window is resized (that
could actually be moved into the server but this is more future-proof and
avoids breaking the protocol).

Revision 1.13 / (download) - annotate - [select for diffs], Tue Aug 11 21:28:11 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

Have the client pass its stdin fd to the server when identifying itself and
have the server use that rather than reopening the tty. If the fd isn't given,
use the old behaviour (so no need for a version change).

This allows tmux to be used as the shell, so also change so that when working
out the command to execute if default-command is empty (the default), tmux will
try not execute itself.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Aug 11 17:18:35 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.11: +45 -29 lines
Diff to previous 1.11 (colored)

Switch tmux to use imsg. This is the last major change to make the
client-server protocol more resilient and make the protocol versioning work
properly. In future, the only things requiring a protocol version bump will be
changes in the message structs, and (when both client and server have this
change) mixing different versions should nicely report an error message.

As a side effect this also makes the code tidier, fixes a problem with the way
errors reported during server startup were handled, and supports fd passing
(which will be used in future).

Looked over by eric@, thanks.

Please note that mixing a client with this change with an older server or vice
versa may cause tmux to crash or hang - tmux should be completely exited before
upgrading.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Aug 8 21:52:43 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.10: +18 -2 lines
Diff to previous 1.10 (colored)

Infrastructure and commands to manage the environment for processes started
within tmux.

There is a global environment, copied from the external environment when the
server is started and each sesssion has an (initially empty) session
environment which overrides it.

New commands set-environment and show-environment manipulate or display the
environments.

A new session option, update-environment, is a space-separated list of
variables which are updated from the external environment into the session
environment every time a new session is created - the default is DISPLAY.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Aug 8 21:18:23 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.9: +9 -9 lines
Diff to previous 1.9 (colored)

Tidy function a little by using a temporary variable.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 30 16:32:12 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.8: +66 -17 lines
Diff to previous 1.8 (colored)

There aren't many client message types or code to handle them so get rid of the
lookup table and use a switch, merge the tiny handler functions into it, and
move the whole lot to client.c.

Also change client_msg_dispatch to consume as many messages as possible and
move the call to it to the right place so it checks for signals afterwards.

Prompted by suggestions from eric@.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jul 30 16:16:19 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (colored)

Tell the server when the client gets SIGTERM so it can clean up the terminal
properly, rather than just exiting.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 26 12:58:44 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.6: +12 -9 lines
Diff to previous 1.6 (colored)

Make all messages sent between the client and server fixed size.

This is the first of two changes to make the protocol more resilient and less
sensitive to other changes in the code, particularly with commands. The client
now packs argv into a buffer and sends it to the server for parsing, rather
than doing it itself and sending the parsed command data.

As a side-effect this also removes a lot of now-unused command marshalling
code.

Mixing a server without this change and a client with or vice versa will cause
tmux to hang or crash, please ensure that tmux is entirely killed before
upgrading.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jul 23 21:19:11 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.5: +1 -3 lines
Diff to previous 1.5 (colored)

None of the server message functions return anything but 0, so make them all
void.

Also remove a leftover variable in client.c.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 23 20:24:27 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.4: +16 -19 lines
Diff to previous 1.4 (colored)

Tidy client message return slightly: convert flags into an enum, and merge
error string into struct client_ctx as well.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 22 21:58:56 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.3: +4 -4 lines
Diff to previous 1.3 (colored)

Pass a set of flags into client_init rather than just a start_server
variable. Only one flag now but more to come later.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jun 25 22:09:20 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.2: +1 -2 lines
Diff to previous 1.2 (colored)

Remove some dead assignments, found by sthen with clang.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 5 07:15:58 2009 UTC (14 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.1: +6 -2 lines
Diff to previous 1.1 (colored)

Call setproctitle earlier in the client, and include the socket name. Makes it
easier to match client to server in ps/pgrep when using several servers.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 22:58:49 2009 UTC (14 years, 11 months ago) by nicm
Branch: MAIN

Import tmux, a terminal multiplexor allowing (among other things) a single
terminal to be switched between several different windows and programs
displayed on one terminal be detached from one terminal and moved to another.

ok deraadt pirofti

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.