summaryrefslogtreecommitdiffstats
path: root/server.c
AgeCommit message (Collapse)Author
2011-03-27Give each pane created in a tmux server a unique id (starting from 0),Nicholas Marriott
put it in the TMUX_PANE environment variable and accept it as a target. Suggested by and with testing and tweaks from Ben Boeckel.
2011-01-26Use LIST_* not SLIST_*.Nicholas Marriott
2011-01-08Move all calls to fcntl(...O_NONBLOCK) into a function and clear theNicholas Marriott
flag on the stdio file descriptors before closing them (fixes things like "tmux ls && cat").
2011-01-01Don't reset the activity timer for unattached sessions every second,Nicholas Marriott
this screws up the choice of most-recently-used. Instead, break the time update into a little function and do it when the session is attached. Pointed out by joshe@.
2010-12-30Change from a per-session stack of buffers to one global stack which isNicholas Marriott
much more convenient and also simplifies lot of code. This renders copy-buffer useless and makes buffer-limit now a server option. By Tiago Cunha.
2010-12-21Store sessions in an RB tree by name rather than a list, this is tidierNicholas Marriott
and allows them to easily be shown sorted in various lists (list-sessions/choose-sessions). Keep a session index which is used in a couple of places internally but make it an ever-increasing number rather than filling in gaps with new sessions.
2010-10-18Merge the before and after attach client code into one in client.cNicholas Marriott
(instead of two in tmux.c and client.c).
2010-10-16Trying to set FD_CLOEXEC on every fd is a lost cause, just useNicholas Marriott
closefrom() before exec.
2010-09-26Two new options:Nicholas Marriott
- server option "exit-unattached" makes the server exit when no clients are attached, even if sessions are present; - session option "destroy-unattached" destroys a session once no clients are attached to it. These are useful for preventing tmux remaining in the background where it is undesirable and when using tmux as a login shell to keep a limit on new sessions.
2010-09-26Modify the permissions on the socket when adding or removing +x to showNicholas Marriott
attached sessions, rather than replacing them.
2010-08-19Do not call event_del() for signals after fork(), just use sigaction()Nicholas Marriott
directly instead - calling libevent functions after fork() w/o event_reinit() is a bad idea, even if in this case it was harmless.
2010-08-04switch back to kqueue for now, since (a) kqueue has been fixed to dealTheo Deraadt
with strange devices and (b) since there appears to be a bull in the poll code in libevent as well... requested by nicm who is away
2010-07-24kqueue(2) is currently broken when used with /dev/null and a few otherNicholas Marriott
devices. An upcoming fix for some problems with the client stdout/stderr handling relies on it working, so make tmux force libevent to use poll(2) via EVENT_NOKQUEUE, until we have fixed kqueue.
2010-06-21Give tmux sockets (but not the containing folder) groupNicholas Marriott
permissions. This allows hardlinks to the sockets to be used more easily.
2010-05-04Put this back in with the initialisation in the right order.Nicholas Marriott
2010-05-04Revert last change, it appears to be broken somehow.Nicholas Marriott
2010-05-03Make signal handler setup/teardown two common functions instead of six,Nicholas Marriott
and reset SIGCHLD after fork to fix problems with some shells. From Romain Francois.
2010-04-06Merge copy mode and output mode, dropping the latter. Idea and code fromNicholas Marriott
Micah Cowan.
2010-03-22Nuke unused variable.Nicholas Marriott
2010-02-06Use the array.h code for the causes list.Nicholas Marriott
2010-02-06Instead of bailing out on the first configuration file error, carry on,Nicholas Marriott
collecting all the errors, then start with the active window in more mode displaying them.
2010-01-30Ignore SIGHUP as well.Nicholas Marriott
2009-12-03Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastNicholas Marriott
time now I've configured emacs to make them displayed in really annoying colours...
2009-12-02Close the pane if the process died due to a signal, not just if it exitedNicholas Marriott
normally.
2009-11-26Remove a couple of unused arguments where possible, and add /* ARGSUSED */ toNicholas Marriott
the rest to reduce lint output.
2009-11-13Destroy panes immediately rather than checking them all every loop.Nicholas Marriott
2009-11-11Free the pane bufferevent when the fd is closed (the signal could come beforeNicholas Marriott
the error callback).
2009-11-11Only need to chmod +x or -x the socket when a client is created, lost orNicholas Marriott
attached, rather than every event loop.
2009-11-05EVLOOP_ONCE takes care of the wakeup, so no need to call event_loopexit(NULL).Nicholas Marriott
2009-11-05Now all timers are events, there is no longer any need to wake up every 50 ms -Nicholas Marriott
only wake up when an event happens.
2009-11-04Move status timer check into the global once-per-second timer, this could maybeNicholas Marriott
be done better but one every second is better than once every 50 ms.
2009-11-04Don't reenlist the client imsg event every loop, instead have a small functionNicholas Marriott
to it and call it after the event triggers or after a imsg is added.
2009-11-04Tell the client to exit on configuration file error.Nicholas Marriott
2009-11-04Convert the window pane (pty master side) fd over to use a bufferevent.Nicholas Marriott
The evbuffer API is very similar to the existing tmux buffer API so this was remarkably painless. Not many possible ways to do it, I suppose.
2009-11-04Call event_init() before loading the config file, since potentially it couldNicholas Marriott
set up events.
2009-11-04Switch jobs over to use a bufferevent.Nicholas Marriott
2009-11-04Initial changes to move tmux to libevent.Nicholas Marriott
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.
2009-11-03Change session and client activity and creation time members to have moreNicholas Marriott
meaningful names. Also, remove the code to try and update the session activity time for the command client when a command message is received as is pointless because it des not have a session.
2009-11-02Reorder slightly to tidy code.Nicholas Marriott
2009-10-27Move the poll registration functions into the server-*.c files.Nicholas Marriott
2009-10-26tabs are better; ok nicmTheo Deraadt
2009-10-26Clear signal flags /before/ taking action and continue afterwards to reduceNicholas Marriott
chance of dropping signals. Pointed out by deraadt@.
2009-10-22Split the server code handling clients, jobs and windows off into separateNicholas Marriott
files from server.c (merging server-msg.c into the client file) and rather than iterating over each set after poll(), allow a callback to be specified when the fd is added and just walk once over the returned pollfds calling each callback where needed. More to come, getting this in so it is tested.
2009-10-13When a session is unattached, reset its activity timer to prevent it lockingNicholas Marriott
instantly when reattached.
2009-10-12Similarly add a tty_cursor_pane function to tidy up most of the calls.Nicholas Marriott
2009-10-12_absolute is redundant, just use tty_region.Nicholas Marriott
2009-10-12Cleanup: use two functions for region setting, one for absolute and one insideNicholas Marriott
pane.
2009-10-11Add a pipe-pane command to allow a pane to be piped to a shell command, forNicholas Marriott
example: pipe-pane 'cat >~/out' No arguments stops outputing and closes the pipe; the -o flag toggles a pipe and on and off (useful for key bindings). Suggested by espie@.
2009-10-11Switch run-shell over to queue the command in the background like #().Nicholas Marriott
2009-10-11Collect status from dead jobs and don't invoke the callback until bothNicholas Marriott
all input (the socket is closed) and status is available.