Commit Graph

9 Commits (ac3b78a84178a308536a56ea114b0f6f8ce6fb47)

Author SHA1 Message Date
Nicholas Marriott c87187f913 When changing so that the client passes its stdout and stderr as well as
stdin up to the server, I forgot one essential point - the tmux server
could now be both the producer and consumer. This happens when tmux is
run inside tmux, as well as when piping tmux commands together.

So, using stdio(3) was a bad idea - if sufficient data was written, this
could block in write(2). When that happened and the server was both
producer and consumer, it deadlocks.

Change to use libevent bufferevents for the client stdin, stdout and
stderr instead. This is trivial enough for output but requires a
callback mechanism to trigger when stdin is finished.

This relies on the underlying polling mechanism for libevent to work
with whatever devices to which the user could redirect stdin, stdout or
stderr, hence the change to use poll(2) over kqueue(2) for tmux.
2010-07-24 20:11:59 +00:00
Nicholas Marriott b9c873cdaa Return the command client return code with MSG_EXIT now that MSG_ERROR and
MSG_PRINT are unused.

New clients should be compatible with old tmux servers but vice versa may print
an error.
2010-07-11 17:06:45 +00:00
Nicholas Marriott 1e8faaa217 Don't die if the client has been detached when the job finishes, just
don't display the output.
2010-05-25 20:05:25 +00:00
Nicholas Marriott 76ef8770cd Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in the
command entry structs and a couple of functions to check/set the flags.
2009-11-13 19:53:28 +00:00
Nicholas Marriott 4d6091379b Switch jobs over to use a bufferevent. 2009-11-04 21:04:43 +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
Nicholas Marriott 88f3ffe86e Remove a debugging leftover and add copyright. 2009-10-11 09:04:33 +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 14ebcab5b0 run-shell command to run a shell command without opening a window, sending
stdout to output mode.
2009-09-20 19:15:01 +00:00