Commit Graph

355 Commits

Author SHA1 Message Date
609baea95e Merge branch 'obsd-master' into master 2021-08-27 20:01:11 +01:00
daec63e5e6 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.
2021-08-27 17:25:55 +00:00
3a76a56824 Merge branch 'obsd-master' into master 2021-02-17 09:58:51 +00:00
ce5de76592 Merge branch 'obsd-master' into master 2021-02-17 09:58:12 +00:00
af3ffa9c41 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.
2021-02-17 07:18:36 +00:00
632636dba5 Do not care about the server socket closing if exiting anyway. 2021-02-12 06:52:48 +00:00
2b58c226db Add a couple of helper functions, and flush imsgs on exit. 2021-02-11 09:39:29 +00:00
e40831a002 Move file handling protocol stuff all into file.c so it can be reused
more easily.
2021-02-11 08:28:45 +00:00
24c15eda79 Merge branch 'obsd-master' into master 2021-01-17 18:01:21 +00:00
a3011be0d2 Look for libevent2 differently from libevent for platforms with both. 2021-01-17 17:21:51 +00:00
71c590a37f Add -N flag to never start server even if command would normally do so,
GitHub issue 2523.
2021-01-17 16:17:41 +00:00
ffe39edf2f Merge branch 'obsd-master' 2020-10-30 20:01:20 +00:00
95841ba16a 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.
2020-10-30 18:54:23 +00:00
a34ceb1074 Merge branch 'obsd-master' 2020-09-22 08:01:18 +01:00
86d6ac2f06 Fix warnings on some platforms with %llx and add a new message to handle
64-bit client flags.
2020-09-22 05:23:34 +00:00
6c437d45ac Merge branch 'obsd-master' 2020-06-18 12:01:22 +01:00
2372b0fdc6 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.
2020-06-18 08:34:22 +00:00
ea4425b9bd Merge branch 'obsd-master' 2020-06-10 10:01:20 +01:00
23d79cfda8 Instead of a buffer size limit on each pane, set a limit of 300 seconds
of data for each client in control mode.
2020-06-10 07:27:10 +00:00
91e40de2da Merge branch 'obsd-master' 2020-06-01 12:01:20 +01:00
a54a88edd6 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.
2020-06-01 09:43:00 +00:00
a4cb700269 Merge branch 'obsd-master' 2020-05-26 14:02:15 +01:00
ea610a3119 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.
2020-05-26 08:41:47 +00:00
212cf53ea9 Merge branch 'obsd-master' 2020-05-13 01:05:04 +01:00
aa7dccf8e1 imsg.h needs uio.h, pointed out by deraadt 2020-05-08 14:15:11 +00:00
1574126e8a 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.
2020-04-27 08:35:09 +00:00
5811dd7ceb Do not close stdout file descriptor in control mode since it will be needed for
printing the exit messages.
2020-04-27 09:33:46 +01:00
c706aadf52 Merge branch 'obsd-master' 2020-04-20 17:42:29 +01:00
c91b4b2e14 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.
2020-04-20 13:25:36 +00:00
b117c3b812 Merge branch 'obsd-master' 2020-04-13 10:30:00 +01:00
c20eb0c0ae Make struct cmd local to cmd.c and move it out of tmux.h. 2020-04-13 08:26:27 +00:00
52e3d960e7 Merge branch 'obsd-master' 2020-04-09 16:01:45 +01:00
b96ac80901 Some unnecessary assignments and unused variables. 2020-04-09 13:52:31 +00:00
588865152a Merge branch 'obsd-master' 2020-03-30 18:01:28 +01:00
34de379c7d Add to rather than replace flags with -c. 2020-03-30 15:49:23 +00:00
1a2e66f345 Merge branch 'obsd-master' 2020-03-12 10:01:25 +00:00
2a5702a936 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.
2020-03-12 09:26:34 +00:00
32be954bdd Merge branch 'obsd-master' 2020-01-29 18:01:24 +00:00
44dad918f8 Warn if a message type that is no longer used is received. 2020-01-29 16:22:32 +00:00
52b6ca5706 Merge branch 'obsd-master' 2019-12-16 18:01:31 +00:00
b4520aaf2c Need to include message size in the maximum buffer calculation. 2019-12-16 16:09:28 +00:00
eaa58d28dc Instead of using large buffers in imsgs, add the data or path onto the end. 2019-12-16 15:48:50 +00:00
e24e9867ec Merge branch 'obsd-master' 2019-12-13 08:01:24 +00:00
6ce943f4d9 Need to check in the error callback also. 2019-12-13 07:00:22 +00:00
828001ecc5 Do not spin waiting for exit, instead check in the write callback. 2019-12-13 06:55:12 +00:00
7922f4ee7b Merge branch 'obsd-master' 2019-12-12 14:33:47 +00:00
c284ebe0ad 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.
2019-12-12 11:39:56 +00:00
b90a9fcd13 Merge branch 'obsd-master' 2019-07-26 23:02:27 +01:00
8f40f791d9 Change "lost server" message to "server exited unexpectedly", from Neal
McBurnett in GitHub issue 1857.
2019-07-26 20:08:40 +00:00
68c2fc6824 Merge branch 'obsd-master' 2019-06-28 17:02:26 +01:00