summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/client.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Tidy up some includes.nicm2014-10-201-1/+2
|
* Call waitpid on SIGCHLD even if client not attached, it is possible (onnicm2014-10-011-9/+5
| | | | | 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.
* Various minor style and spacing nits.nicm2014-09-011-3/+3
|
* lockf is entirely useless and it was a mistake to change to it, go backnicm2014-07-211-13/+37
| | | | | to using flock which actually works sensibly. Also always retry the lock to fix a potential race, and add some extra logging.
* An EOF is a good reason to close a connection.krw2014-07-131-2/+2
| | | | ok nicm@
* fcntl.h is still needed here.nicm2014-04-291-1/+2
|
* Remove some unnecessary includes and fix a typo.nicm2014-04-171-3/+1
|
* Fix a memory/fd leak reported by Tiago Cunha.nicm2014-01-091-3/+8
|
* Three small changes from Tiago Cunha:nicm2014-01-091-2/+3
| | | | | | - 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.
* from nicm: : handle msgbuf_write() returning EAGAINbenno2013-11-131-2/+2
|
* Use format_get_command() and some spacing tweaks.nicm2013-10-101-1/+2
|
* We accidentally haven't been using $TMUX to work out the session for anicm2013-10-101-5/+1
| | | | | | 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.
* Show session name in detached message. Requested by somebody a fewnicm2013-10-101-4/+19
| | | | months ago who didn't bother testing it. But it works for me anyway.
* Don't look at string[length - 1] if length == 0.nicm2013-10-101-3/+3
|
* Alter how tmux handles the working directory to internally use filenicm2013-10-101-34/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048.nicm2013-10-101-16/+50
|
* Instead of fixed size buffers for some messages, send only the stringnicm2013-10-101-36/+32
| | | | length.
* Merge IDENTIFY_* flags with CLIENT_* flags.nicm2013-10-101-10/+8
|
* Remove CMD_SENDENVIRON.nicm2013-10-101-6/+3
|
* Use lockf which is more portable than flock, from Dagobert Michelsen.nicm2013-04-221-3/+3
|
* We ignore SIGWINCH until ready, so send a MSG_RESIZE immediately whennicm2013-03-251-1/+2
| | | | becoming ready.
* Rename session idx to session id throughout and add $ prefix to targetsnicm2013-03-251-2/+2
| | | | to use it, extended from a diff from George Nachman.
* Send DSC 1000p at the beginning of a -CC client's lifetime and ST andnicm2013-03-251-2/+10
| | | | the end, from George Nachman.
* Add a command queue to standardize and simplify commands that call othernicm2013-03-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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.nicm2013-03-221-5/+1
|
* If stdin in the client is enable immediately, tmux will eat anythingnicm2012-09-031-2/+7
| | | | | | | 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.
* Change a log to fprintf that was missed last time around, from Tiago Cunha.nicm2012-08-271-2/+2
|
* xfree is not particularly helpful, remove it. From Thomas Adam.nicm2012-07-101-2/+2
|
* Actually write all the data to stdout/stderr.nicm2012-06-181-3/+22
|
* Add a skeleton mode to tmux (called "control mode") that let's tmuxnicm2012-06-181-2/+27
| | | | | | | 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.
* Simplify logging and just fprintf(stderr, ...) for early errors.nicm2012-05-251-6/+6
|
* Instead of passing stdin/stdout/stderr file descriptors over imsg andnicm2012-05-211-16/+50
| | | | | | | | | | | 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.
* Add missing prototype.nicm2012-04-231-1/+2
|
* Use an enum for client exit reasons, from George Nachman.nicm2012-04-231-12/+47
|
* Add sys/file.h.nicm2012-03-241-1/+2
|
* Move MSG_IDENTIFY to the last sent by the client, this will be needed bynicm2012-03-191-6/+6
| | | | control clients and irrelevant for others.
* Use a lock file and flock() to serialize server start, avoids problemsnicm2012-03-091-14/+41
| | | | | when running a bunch of tmux from cron at the same time. Based on a diff from Tim Ruehsen.
* Add a -P option to detach to HUP the client's parent process (usuallynicm2011-03-031-4/+17
| | | | causing it to exit as well).
* Move all calls to fcntl(...O_NONBLOCK) into a function and clear thenicm2011-01-081-6/+3
| | | | | flag on the stdio file descriptors before closing them (fixes things like "tmux ls && cat").
* Merge the before and after attach client code into one in client.cnicm2010-10-181-94/+243
| | | | (instead of two in tmux.c and client.c).
* Trying to set FD_CLOEXEC on every fd is a lost cause, just usenicm2010-10-161-3/+1
| | | | closefrom() before exec.
* Can't call event_del() without event_set() first - so call event_set()nicm2010-08-231-1/+2
| | | | when setting up the client.
* MSG_EXIT can now have a return code in the message, so check for thatnicm2010-08-221-2/+3
| | | | size as well. Stops the client fatal()ing on exit.
* Send all three of stdin, stdout, stderr from the client to the server, so thatnicm2010-06-281-3/+10
| | | | | | | | 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).
* Fix problems with window sizing seen by Raghavendra D Prabhu whennicm2010-06-051-1/+8
| | | | | | | | | | | | | | | | | | 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.
* This ioctl(TIOCGWINSZ) call is no longer necessary, the result is nevernicm2010-06-051-5/+1
| | | | used and the server now does it later on the tty fd directly.
* Catch SIGHUP and terminate if running as a client. This prevents clientsjsing2010-05-121-1/+6
| | | | | | | from being left hanging around when, for example, a SSH session is disconnected. ok nicm@
* Put this back in with the initialisation in the right order.nicm2010-05-041-25/+2
|
* Revert last change, it appears to be broken somehow.nicm2010-05-041-2/+25
|
* Make signal handler setup/teardown two common functions instead of six,nicm2010-05-031-25/+2
| | | | | and reset SIGCHLD after fork to fix problems with some shells. From Romain Francois.