summaryrefslogtreecommitdiffstats
path: root/client.c
AgeCommit message (Collapse)Author
2021-02-11Move file handling protocol stuff all into file.c so it can be reusednicm
more easily.
2021-01-17Add -N flag to never start server even if command would normally do so,nicm
GitHub issue 2523.
2020-10-30With csh, a tmux client gets SIGTERM before SIGCONT when killed withnicm
"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-09-22Fix warnings on some platforms with %llx and add a new message to handlenicm
64-bit client flags.
2020-06-18Add a flag to make a client wait for an empty line before exiting innicm
control mode to avoid stray commands ending up in the shell.
2020-06-10Instead of a buffer size limit on each pane, set a limit of 300 secondsnicm
of data for each client in control mode.
2020-06-01Instead of sending all data to control mode clients as fast as possible,nicm
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-05-26Pass the stdout file descriptor from the client as well as stdin and usenicm
them for control clients directly instead of passing everything via the client.
2020-05-08imsg.h needs uio.h, pointed out by deraadtnicm
2020-04-27Do not close the stdout file descriptor in control mode as it will benicm
needed for printing the exit messages. Fixes a bug when detaching with iTerm2.
2020-04-20Tidy up the terminal detection and feature code and add named sets ofnicm
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-13Make struct cmd local to cmd.c and move it out of tmux.h.nicm
2020-04-09Some unnecessary assignments and unused variables.nicm
2020-03-30Add to rather than replace flags with -c.nicm
2020-03-12When the server socket is given by the user with -S, create it withnicm
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-01-29Warn if a message type that is no longer used is received.nicm
2019-12-16Need to include message size in the maximum buffer calculation.nicm
2019-12-16Instead of using large buffers in imsgs, add the data or path onto the end.nicm
2019-12-13Need to check in the error callback also.nicm
2019-12-13Do not spin waiting for exit, instead check in the write callback.nicm
2019-12-12Rewrite the code for reading and writing files. Now, if the client isnicm
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-07-26Change "lost server" message to "server exited unexpectedly", from Nealnicm
McBurnett in GitHub issue 1857.
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt
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.
2019-05-25Merge cmd_list_parse into cmd-parse.y so it can use the new aliasnicm
processing code.
2018-11-22Do not use PWD unless it actually matches the real working directory.nicm
2018-04-26Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther
Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
2018-01-01Prefer PWD for current directory if present in client, from Wei Zhao innicm
GitHub issue 1183.
2017-12-19Report better error from server when socket create fails, GitHub issuenicm
1201.
2017-12-18Do not try to put more in command message than will fit when sendingnicm
(the server will treat as a fatal error). GitHub issue 1200.
2017-07-14Because ignore SIGCHLD early, letting signal_del restore it doesn't worknicm
correctly, so set it explicitly back to default (and the others for good measure).
2017-07-12Move signal code into proc.c.nicm
2017-07-12Make shell_command a global like other stuff rather than making it annicm
exception and using callback argument.
2017-01-24Add support for custom command aliases, this is an array option whichnicm
contains items of the form "alias=command". This is consulted when an unknown command is parsed.
2017-01-23Open /dev/ptm before pledge() and save it to be used for PTMGET laternicm
(this means inlining forkpty()). ok deraadt
2017-01-20Print error rather than fatal() if tcgetattr() fails, which is much morenicm
useful to user.
2017-01-16Revert WIP parts of previous I didn't mean to commit yet.nicm
2017-01-16getopt() has a struct option so just return to using options_entry.nicm
2017-01-13Add -E to detach-client to exec a command to replace the client insteadnicm
of exiting it, useful if tmux wasn't exec'd itself. From Jenna Magius.
2016-10-03Remove some dead code in cmd-move-window.c and make a load of localnicm
functions static.
2016-01-19I no longer use my SourceForge address so replace it.nicm
2015-11-25Don't print error if none to print.nicm
2015-11-24Shell command from -c doesn't have to be global, pass it as an argument.nicm
2015-11-24Do lock failures slightly better, return a special value so we don'tnicm
unlink the wrong thing.
2015-11-24Actually show something (even if it not that helpful) if the servernicm
fails to start (for example if it can't create the socket), rather than hanging or showing nothing.
2015-11-24Tidy the code that works out the socket path, and just use the full pathnicm
in the global socket_path rather than copying it.
2015-11-24Switch a fprintf to a fatal, and wrap some long lines.nicm
2015-11-18Use __unused rather than rolling our own.nicm
2015-11-15Accidentally turned off pledge, turn it back on.nicm
2015-11-14Push stdout and stderr to clients more aggressively, and add an event tonicm
continue if the send fails.
2015-10-31Don't shift version out of peerid, it is needed later.nicm