summaryrefslogtreecommitdiffstats
path: root/client.c
AgeCommit message (Collapse)Author
2015-10-31Don't shift version out of peerid, it is needed later.nicm
2015-10-31Because pledge(2) does not allow us to pass directory file descriptorsnicm
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).
2015-10-28Like options, move the environ struct into environ.c.nicm
2015-10-27Move struct options into options.c.nicm
2015-10-27Break the common process set up, event loop and imsg dispatch codenicm
between server and client out into a separate internal API. This will make it easier to add another process.
2015-10-18Pass current directory as a string rather than a file descriptor becausenicm
pledge doesn't let us pass directory file descriptors.
2015-10-17Add pledge "stdio unix sendfd proc exec tty" to tmux client process,nicm
"sendfd" is dropped after first message from the server.
2015-10-11Userspace doesn't need to use SUN_LEN(): connect() and bind() must acceptguenther
sizeof(struct sockaddr_un), so do the simple, portable thing ok beck@ deraadt@
2015-09-24Don't leak fd and path on failure.nicm
2015-09-09No need to keep global options around for client which doesn't use them.nicm
2015-08-30Login shell can be a client flag, and move the exec code into client.c.nicm
2015-08-30Event base does not need to be global.nicm
2015-07-13Ignore environment variables that are too long to send to the server.nicm
2015-06-14Add a format for client PID (client_pid) and server PID (pid). Diff fornicm
client_pid from Thomas Adam.
2015-06-04Move the nested check from client to server and compare the client ttynicm
name to all the pane pty names instead of comparing socket paths. This means that "new -d" will work without unsetting $TMUX.
2015-04-24Set up signal handler earlier so that we don't get zombies, reported bynicm
sobrado@.
2015-04-21Simplify error messages when socket connect fails, suggested by "Karthik K".nicm
2015-03-31Fix some format specifier nits, from Ben Boeckel.nicm
2014-10-20Tidy up some includes.nicm
2014-10-01Call waitpid on SIGCHLD even if client not attached, it is possible (onnicm
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.
2014-09-01Various minor style and spacing nits.nicm
2014-07-21lockf is entirely useless and it was a mistake to change to it, go backnicm
to using flock which actually works sensibly. Also always retry the lock to fix a potential race, and add some extra logging.
2014-07-13An EOF is a good reason to close a connection.krw
ok nicm@
2014-04-29fcntl.h is still needed here.nicm
2014-04-17Remove some unnecessary includes and fix a typo.nicm
2014-01-09Fix a memory/fd leak reported by Tiago Cunha.nicm
2014-01-09Three small changes from Tiago Cunha:nicm
- 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.
2013-11-13from nicm: : handle msgbuf_write() returning EAGAINbenno
2013-10-10Use format_get_command() and some spacing tweaks.nicm
2013-10-10We accidentally haven't been using $TMUX to work out the session for anicm
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-10Show session name in detached message. Requested by somebody a fewnicm
months ago who didn't bother testing it. But it works for me anyway.
2013-10-10Don't look at string[length - 1] if length == 0.nicm
2013-10-10Alter how tmux handles the working directory to internally use filenicm
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-10Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048.nicm
2013-10-10Remove CMD_SENDENVIRON.nicm
2013-04-22Use lockf which is more portable than flock, from Dagobert Michelsen.Nicholas Marriott
2013-03-25We ignore SIGWINCH until ready, so send a MSG_RESIZE immediately whenNicholas Marriott
becoming ready.
2013-03-25Rename session idx to session id throughout and add $ prefix to targetsNicholas Marriott
to use it, extended from a diff from George Nachman.
2013-03-25Send DSC 1000p at the beginning of a -CC client's lifetime and ST andNicholas Marriott
the end, from George Nachman.
2013-03-24Add a command queue to standardize and simplify commands that call otherNicholas Marriott
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-22No more lint means no more ARGSUSED.Nicholas Marriott
2012-09-03If stdin in the client is enable immediately, tmux will eat anythingNicholas Marriott
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.
2012-08-27Change a log to fprintf that was missed last time around, from Tiago Cunha.Nicholas Marriott
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-06-18Actually write all the data to stdout/stderr.Nicholas Marriott
2012-06-18Add a skeleton mode to tmux (called "control mode") that let's tmuxNicholas Marriott
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.
2012-05-25Simplify logging and just fprintf(stderr, ...) for early errors.Nicholas Marriott
2012-05-21Instead of passing stdin/stdout/stderr file descriptors over imsg andNicholas Marriott
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.
2012-04-23Add missing prototype.Nicholas Marriott
2012-04-23Use an enum for client exit reasons, from George Nachman.Nicholas Marriott