Commit Graph

121 Commits

Author SHA1 Message Date
Nicholas Marriott
abb728684b Add back JOB_PERSIST checks that got lost. 2009-11-04 21:10:49 +00:00
Nicholas Marriott
4d6091379b Switch jobs over to use a bufferevent. 2009-11-04 21:04:43 +00:00
Nicholas Marriott
abf3a5d50e Initial changes to move tmux to libevent.
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-04 20:50:11 +00:00
Tiago Cunha
053e40572c Sync OpenBSD patchset 475:
Add a flag for jobs that shouldn't be freed after they've died and use it for
status jobs, then only kill those jobs when status-left, status-right or
set-titles-string is changed.

Fixes problems with changing options from inside #().
2009-11-02 21:38:27 +00:00
Nicholas Marriott
2f813ef75d Add a flag for jobs that shouldn't be freed after they've died and use it for
status jobs, then only kill those jobs when status-left, status-right or
set-titles-string is changed.

Fixes problems with changing options from inside #().
2009-11-01 23:20:37 +00:00
Tiago Cunha
31552722a8 Sync OpenBSD patchset 431:
Remove unused function.
2009-10-23 17:27:40 +00:00
Nicholas Marriott
a22c06a2d6 Remove unused function. 2009-10-21 18:20:16 +00:00
Nicholas Marriott
4afecbe400 Getting the read and write ends of the pipe the right way round is usually
recommended. DOH.
2009-10-21 07:37:11 +00:00
Nicholas Marriott
7825871d6a Getting the read and write ends of the pipe the right way round is usually
recommended. DOH.
2009-10-21 07:24:23 +00:00
Nicholas Marriott
6f2169037e Sort out stdout before stdin/stderr in case the stdout side of the pipe got one
of their fds.
2009-10-20 22:15:32 +00:00
Tiago Cunha
197f8b88bf Sync OpenBSD patchset 384:
Switch run-shell over to queue the command in the background like #().
2009-10-12 00:25:25 +00:00
Tiago Cunha
c8d0608369 Sync OpenBSD patchset 383:
There isn't much point in having a free function if it isn't used.

Also allow a NULL tree.
2009-10-12 00:22:17 +00:00
Tiago Cunha
1b03bc2404 Sync OpenBSD patchset 382:
Collect status from dead jobs and don't invoke the callback until both
all input (the socket is closed) and status is available.
2009-10-12 00:21:08 +00:00
Tiago Cunha
d7fa9bc056 Sync OpenBSD patchset 379:
Put all jobs on a global all_jobs list and use that in server.c instead of
running through all the clients.
2009-10-12 00:12:33 +00:00
Tiago Cunha
3e93bdf31b Do not include paths.h, since it's OS-dependent, due to OpenBSD patchset 374. 2009-10-11 23:59:34 +00:00
Tiago Cunha
bc236109fd Sync OpenBSD patchset 374:
Rather than running status-left, status-right and window title #() with popen
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.
2009-10-11 23:55:26 +00:00
Nicholas Marriott
cebc988dd4 Switch run-shell over to queue the command in the background like #(). 2009-10-11 08:58:05 +00:00
Nicholas Marriott
abedfa77da There isn't much point in having a free function if it isn't used.
Also allow a NULL tree.
2009-10-11 07:30:07 +00:00
Nicholas Marriott
ff4b4e667a Collect status from dead jobs and don't invoke the callback until both
all input (the socket is closed) and status is available.
2009-10-11 07:20:16 +00:00
Nicholas Marriott
095ecf2d90 Put all jobs on a global all_jobs list and use that in server.c instead of
running through all the clients.
2009-10-10 18:42:14 +00:00
Nicholas Marriott
6bca92db4d Rather than running status-left, status-right and window title #() with popen
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.
2009-10-10 15:03:01 +00:00