aboutsummaryrefslogtreecommitdiff
path: root/client.c
Commit message (Collapse)AuthorAge
...
| * imsg_read returns ssize_t not int, pointed out by lint via deraadt.Nicholas Marriott2009-11-13
| |
| * Don't return 1 unless there was actually a problem (signal/lost server) ratherNicholas Marriott2009-11-10
| | | | | | | | than for all events (normal exit/detach/etc).
| * Move some common code into a function.Nicholas Marriott2009-11-04
| |
| * Initial changes to move tmux to libevent.Nicholas Marriott2009-11-04
| | | | | | | | | | | | | | | | | | 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.
| * Leftover unused variable :-/.Nicholas Marriott2009-11-02
| |
| * There isn't much point in doing lstat before connect so instead just do connectNicholas Marriott2009-11-02
| | | | | | | | and handle ENOENT from it which is a little tidier.
| * Clear signal flags /before/ taking action and continue afterwards to reduceNicholas Marriott2009-10-26
| | | | | | | | chance of dropping signals. Pointed out by deraadt@.
| * Tidy identify message send into a separate function.Nicholas Marriott2009-10-21
| |
| * Client tidying: get rid of client_ctx struct in favour of two variables inNicholas Marriott2009-10-21
| | | | | | | | client.c, and move the functions in client-fn.c into other files.
| * Do this in a better way - print messages when exiting with nonzero.Nicholas Marriott2009-10-13
| | | | | | | | | | Also remove the login shell information from server-info, only the client should care about it.
| * Don't print exit messages when used as a login shell, requested by martynas@ aNicholas Marriott2009-10-13
| | | | | | | | while back.
| * Support -c like sh(1) to execute a command, useful when tmux is a loginNicholas Marriott2009-09-23
| | | | | | | | | | | | | | shell. Suggested by halex@. This includes another protocol version increase (the last for now) so again restart the tmux server before upgrading.
| * Remove the internal tmux locking and instead detach each client and run theNicholas Marriott2009-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Trim some code by moving the ioctl(TIOCGWINSZ) after SIGWINCH from the clientNicholas Marriott2009-09-23
| | | | | | | | | | | | | | 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.
| * Don't attempt to open() the tty path, rely on the client sending its stdin fdNicholas Marriott2009-09-23
| | | | | | | | | | | | | | | | | | 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.
| * Regularise some fatal messages.Nicholas Marriott2009-09-20
| |
| * Fix a race condition when asking a client to take over the terminal (switchingNicholas Marriott2009-09-02
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * That was the wrong fix. MSG_ERROR should set the error and the client shouldNicholas Marriott2009-09-02
| | | | | | | | | | | | 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.
| * Set exittype for error exit as well as the error string.Nicholas Marriott2009-09-02
| |
| * imsg closes the fd after sending, so dup() STDIN_FILENO before passing it toNicholas Marriott2009-08-12
| | | | | | | | | | | | 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).
| * Have the client pass its stdin fd to the server when identifying itself andNicholas Marriott2009-08-11
| | | | | | | | | | | | | | | | | | 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.
| * Switch tmux to use imsg. This is the last major change to make theNicholas Marriott2009-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Infrastructure and commands to manage the environment for processes startedNicholas Marriott2009-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Tidy function a little by using a temporary variable.Nicholas Marriott2009-08-08
| |
| * There aren't many client message types or code to handle them so get rid of theNicholas Marriott2009-07-30
| | | | | | | | | | | | | | | | | | | | 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@.
| * Tell the server when the client gets SIGTERM so it can clean up the terminalNicholas Marriott2009-07-30
| | | | | | | | properly, rather than just exiting.
| * Make all messages sent between the client and server fixed size.Nicholas Marriott2009-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * None of the server message functions return anything but 0, so make them allNicholas Marriott2009-07-23
| | | | | | | | | | | | void. Also remove a leftover variable in client.c.
| * Tidy client message return slightly: convert flags into an enum, and mergeNicholas Marriott2009-07-23
| | | | | | | | error string into struct client_ctx as well.
| * Pass a set of flags into client_init rather than just a start_serverNicholas Marriott2009-07-22
| | | | | | | | variable. Only one flag now but more to come later.
| * Remove some dead assignments, found by sthen with clang.Nicholas Marriott2009-06-25
| |
| * Call setproctitle earlier in the client, and include the socket name. Makes itNicholas Marriott2009-06-05
| | | | | | | | easier to match client to server in ps/pgrep when using several servers.
| * Import tmux, a terminal multiplexor allowing (among other things) a singleNicholas Marriott2009-06-01
| | | | | | | 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
* Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-codeNicholas Marriott2013-03-11
|\
| * Rename session idx to session id throughout and add $ prefix to targets to useNicholas Marriott2013-03-07
| | | | | | | | it, extended from a diff from George Nachman.
* | We ignore SIGWINCH until ready, so send a MSG_RESIZE immediately when becomingNicholas Marriott2013-03-11
|/ | | | ready.
* Send DSC 1000p at the beginning of a -CC client's lifetime and ST and the end,Nicholas Marriott2013-03-04
| | | | from George Nachman..
* Add a command queue to standardize and simplify commands that call otherNicholas Marriott2013-02-23
| | | | | | | | | | | | | | | | | | | | 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.
* No more lint means no more ARGSUSED.Nicholas Marriott2013-02-17
|
* If stdin in the client is enable immediately, tmux will eat anythingNicholas Marriott2012-09-04
| | | | | | | 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.
* Sync OpenBSD patchset 1168:Tiago Cunha2012-08-31
| | | | | Change a log to fprintf that was missed last time around, from Tiago Cunha.
* Sync OpenBSD patchset 1150:Tiago Cunha2012-07-11
| | | | | xfree is not particularly helpful, remove it. From Thomas Adam.
* More ifdef goo is needed due to NOKERNINFO.Tiago Cunha2012-06-18
|
* Sync OpenBSD patchset 1139:Tiago Cunha2012-06-18
| | | | | Actually write all the data to stdout/stderr.
* Sync OpenBSD patchset 1138:Tiago Cunha2012-06-18
| | | | | | | | | 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.
* Sync OpenBSD patchset 1123:Tiago Cunha2012-05-30
| | | | | Simplify logging and just fprintf(stderr, ...) for early errors.
* Sync OpenBSD patchset 1114:Tiago Cunha2012-05-22
| | | | | | | | | | | | | 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.
* Sync OpenBSD patchset 1101:Tiago Cunha2012-04-24
| | | | | Add missing prototype.
* Sync OpenBSD patchset 1100:Tiago Cunha2012-04-24
| | | | | Use an enum for client exit reasons, from George Nachman.
* Sync OpenBSD patchset 1080:Tiago Cunha2012-03-29
| | | | | Add sys/file.h.