summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Store sessions in an RB tree by name rather than a list, this is tidiernicm2010-12-211-34/+27
| | | | | | | | | 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.
* Merge the before and after attach client code into one in client.cnicm2010-10-181-8/+4
| | | | (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.
* Two new options:nicm2010-09-261-5/+7
| | | | | | | | | | | | - 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.
* Modify the permissions on the socket when adding or removing +x to shownicm2010-09-261-6/+17
| | | | attached sessions, rather than replacing them.
* Do not call event_del() for signals after fork(), just use sigaction()nicm2010-08-191-2/+2
| | | | | directly instead - calling libevent functions after fork() w/o event_reinit() is a bad idea, even if in this case it was harmless.
* switch back to kqueue for now, since (a) kqueue has been fixed to dealderaadt2010-08-041-4/+1
| | | | | | 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
* kqueue(2) is currently broken when used with /dev/null and a few othernicm2010-07-241-1/+4
| | | | | | | | 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.
* Give tmux sockets (but not the containing folder) groupnicm2010-06-211-4/+4
| | | | | permissions. This allows hardlinks to the sockets to be used more easily.
* Put this back in with the initialisation in the right order.nicm2010-05-041-62/+7
|
* Revert last change, it appears to be broken somehow.nicm2010-05-041-8/+62
|
* Make signal handler setup/teardown two common functions instead of six,nicm2010-05-031-62/+8
| | | | | and reset SIGCHLD after fork to fix problems with some shells. From Romain Francois.
* Merge copy mode and output mode, dropping the latter. Idea and code fromnicm2010-04-061-3/+4
| | | | Micah Cowan.
* Nuke unused variable.nicm2010-03-221-3/+2
|
* Use the array.h code for the causes list.nicm2010-02-061-12/+12
|
* Instead of bailing out on the first configuration file error, carry on,nicm2010-02-061-27/+30
| | | | | collecting all the errors, then start with the active window in more mode displaying them.
* Ignore SIGHUP as well.nicm2010-01-301-1/+5
|
* Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastnicm2009-12-031-4/+4
| | | | | time now I've configured emacs to make them displayed in really annoying colours...
* Close the pane if the process died due to a signal, not just if it exitednicm2009-12-021-2/+2
| | | | normally.
* Remove a couple of unused arguments where possible, and add /* ARGSUSED */ tonicm2009-11-261-1/+4
| | | | the rest to reduce lint output.
* Destroy panes immediately rather than checking them all every loop.nicm2009-11-131-5/+3
|
* Free the pane bufferevent when the fd is closed (the signal could come beforenicm2009-11-111-1/+2
| | | | the error callback).
* Only need to chmod +x or -x the socket when a client is created, lost ornicm2009-11-111-7/+4
| | | | attached, rather than every event loop.
* EVLOOP_ONCE takes care of the wakeup, so no need to call event_loopexit(NULL).nicm2009-11-051-2/+1
|
* Now all timers are events, there is no longer any need to wake up every 50 ms -nicm2009-11-051-7/+2
| | | | only wake up when an event happens.
* Move status timer check into the global once-per-second timer, this could maybenicm2009-11-041-1/+3
| | | | be done better but one every second is better than once every 50 ms.
* Don't reenlist the client imsg event every loop, instead have a small functionnicm2009-11-041-5/+3
| | | | to it and call it after the event triggers or after a imsg is added.
* Tell the client to exit on configuration file error.nicm2009-11-041-1/+2
|
* Convert the window pane (pty master side) fd over to use a bufferevent.nicm2009-11-041-2/+1
| | | | | 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.
* Call event_init() before loading the config file, since potentially it couldnicm2009-11-041-3/+3
| | | | set up events.
* Switch jobs over to use a bufferevent.nicm2009-11-041-5/+3
|
* Initial changes to move tmux to libevent.nicm2009-11-041-313/+264
| | | | | | | | | 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.
* Change session and client activity and creation time members to have morenicm2009-11-031-5/+7
| | | | | | | | 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.
* Reorder slightly to tidy code.nicm2009-11-021-7/+6
|
* Move the poll registration functions into the server-*.c files.nicm2009-10-271-88/+5
|
* tabs are better; ok nicmderaadt2009-10-261-5/+5
|
* Clear signal flags /before/ taking action and continue afterwards to reducenicm2009-10-261-3/+5
| | | | chance of dropping signals. Pointed out by deraadt@.
* Split the server code handling clients, jobs and windows off into separatenicm2009-10-221-876/+120
| | | | | | | | | 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.
* When a session is unattached, reset its activity timer to prevent it lockingnicm2009-10-131-1/+11
| | | | instantly when reattached.
* Similarly add a tty_cursor_pane function to tidy up most of the calls.nicm2009-10-121-3/+3
|
* _absolute is redundant, just use tty_region.nicm2009-10-121-2/+2
|
* Cleanup: use two functions for region setting, one for absolute and one insidenicm2009-10-121-2/+3
| | | | pane.
* Add a pipe-pane command to allow a pane to be piped to a shell command, fornicm2009-10-111-1/+18
| | | | | | | | | | | 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@.
* Switch run-shell over to queue the command in the background like #().nicm2009-10-111-4/+8
|
* Collect status from dead jobs and don't invoke the callback until bothnicm2009-10-111-6/+28
| | | | all input (the socket is closed) and status is available.
* Clean up by introducing a wrapper struct for mouse clicks rather than passingnicm2009-10-111-5/+5
| | | | | | | three u_chars around. As a side-effect this fixes incorrectly rejecting high cursor positions (because it was comparing them as signed char), reported by Tom Doherty.
* Braek some bits out of server_fill_client() that aren't really related tonicm2009-10-111-33/+43
| | | | polling into their own function.
* Put all jobs on a global all_jobs list and use that in server.c instead ofnicm2009-10-101-36/+4
| | | | running through all the clients.
* Rather than running status-left, status-right and window title #() with popennicm2009-10-101-3/+77
| | | | | | | | | | | | | | | | | immediately every redraw, queue them up and run them in the background, starting each once every status-interval. The actual status line uses the output from the last run. This brings several advantages: - tmux itself may be called from inside #() without causing the server to hang; - likewise, sleep or similar doesn't cause the server to block; - commands aren't run excessively often when redrawing; - commands shared by status-left and status-right, or used multiple times, will only be run once. run-shell and if-shell still use system()/popen() but will be changed over to use this too later.
* New option, mouse-select-pane. If on, the mouse may be used to select thenicm2009-10-101-3/+14
| | | | | | current pane. Suggested by sthen@ and also by someone else ages ago who I have forgotten.