Instant Terminal Sharing
Go to file
Tiago Cunha d7bae0edce Sync OpenBSD patchset 741:
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-08-09 21:44:25 +00:00
compat Sync OpenBSD patchset 706: 2010-06-06 00:08:28 +00:00
examples Basic GNU bash completion from Frank Barknecht. 2010-08-09 18:22:33 +00:00
tools Don't hard-code the username. 2010-07-19 13:57:22 +00:00
www Mention dependencies. 2010-03-10 22:13:17 +00:00
array.h Sync OpenBSD patchset 714: 2010-06-06 00:27:08 +00:00
attributes.c Sync OpenBSD patchset 700: 2010-06-05 23:54:51 +00:00
cfg.c Sync OpenBSD patchset 704: 2010-06-06 00:04:18 +00:00
CHANGES Changes for 1.3. 2010-07-18 13:40:59 +00:00
client.c Sync OpenBSD patchset 731: 2010-07-02 02:52:13 +00:00
clock.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-attach-session.c Sync OpenBSD patchset 639: 2010-02-08 18:27:34 +00:00
cmd-bind-key.c Sync OpenBSD patchset 727: 2010-07-02 02:43:01 +00:00
cmd-break-pane.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-capture-pane.c Sync OpenBSD patchset 612: 2010-01-22 17:29:19 +00:00
cmd-choose-buffer.c Sync OpenBSD patchset 726: 2010-06-22 23:35:20 +00:00
cmd-choose-client.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-choose-session.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-choose-window.c Sync OpenBSD patchset 724: 2010-06-22 23:26:18 +00:00
cmd-clear-history.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-clock-mode.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-command-prompt.c Sync OpenBSD patchset 697: 2010-05-14 14:33:39 +00:00
cmd-confirm-before.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-copy-buffer.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-copy-mode.c Merge output (more) and copy modes into one single mode (called copy). 2010-04-05 05:11:44 +00:00
cmd-delete-buffer.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-detach-client.c Sync OpenBSD patchset 639: 2010-02-08 18:27:34 +00:00
cmd-display-message.c Sync OpenBSD patchset 561: 2009-11-28 14:39:53 +00:00
cmd-display-panes.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-find-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-generic.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-has-session.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-if-shell.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
cmd-join-pane.c Don't try to use a window-link that may have been freed. 2010-04-09 07:09:37 +00:00
cmd-kill-pane.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-kill-server.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-kill-session.c Sync OpenBSD patchset 728: 2010-07-02 02:43:50 +00:00
cmd-kill-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-last-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-link-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-list-buffers.c Sync OpenBSD patchset 726: 2010-06-22 23:35:20 +00:00
cmd-list-clients.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-list-commands.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-list-keys.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-list-panes.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-list-sessions.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-list-windows.c Sync OpenBSD patchset 732: 2010-07-02 02:54:52 +00:00
cmd-list.c Sync OpenBSD patchset 727: 2010-07-02 02:43:01 +00:00
cmd-load-buffer.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
cmd-lock-client.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-lock-server.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-lock-session.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-move-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-new-session.c Sync OpenBSD patchset 730: 2010-07-02 02:49:19 +00:00
cmd-new-window.c Sync OpenBSD patchset 730: 2010-07-02 02:49:19 +00:00
cmd-next-layout.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-next-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-paste-buffer.c No vis.h in here. 2010-06-06 00:03:02 +00:00
cmd-pipe-pane.c Sync OpenBSD patchset 720: 2010-06-15 20:25:40 +00:00
cmd-previous-layout.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-previous-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-refresh-client.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-rename-session.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-rename-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-resize-pane.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-respawn-window.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-rotate-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-run-shell.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
cmd-save-buffer.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
cmd-select-layout.c Sync OpenBSD patchset 732: 2010-07-02 02:54:52 +00:00
cmd-select-pane.c Support up, down, left, right movement through panes with -UDLR flags to 2010-03-15 22:03:38 +00:00
cmd-select-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-send-keys.c Pass in the session, rather than the client, to window modes' key() function. 2010-05-22 21:56:04 +00:00
cmd-send-prefix.c Pass in the session, rather than the client, to window modes' key() function. 2010-05-22 21:56:04 +00:00
cmd-server-info.c Sync OpenBSD patchset 585: 2009-12-10 16:59:02 +00:00
cmd-set-buffer.c Sync OpenBSD patchset 569: 2009-11-28 14:54:12 +00:00
cmd-set-environment.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-set-option.c Sync OpenBSD patchset 729: 2010-07-02 02:45:52 +00:00
cmd-set-window-option.c Sync OpenBSD patchset 580: 2009-12-04 22:11:23 +00:00
cmd-show-buffer.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-show-environment.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-show-messages.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-show-options.c Sync OpenBSD patchset 585: 2009-12-10 16:59:02 +00:00
cmd-show-window-options.c Sync OpenBSD patchset 580: 2009-12-04 22:11:23 +00:00
cmd-source-file.c Sync OpenBSD patchset 640: 2010-02-08 18:29:32 +00:00
cmd-split-window.c Sync OpenBSD patchset 730: 2010-07-02 02:49:19 +00:00
cmd-start-server.c Sync OpenBSD patchset 567: 2009-11-28 14:50:37 +00:00
cmd-string.c Sync OpenBSD patchset 649: 2010-02-26 13:27:38 +00:00
cmd-suspend-client.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-swap-pane.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd-swap-window.c Sync OpenBSD patchset 539: 2009-11-14 17:56:39 +00:00
cmd-switch-client.c Sync OpenBSD patchset 614: 2010-01-25 17:12:44 +00:00
cmd-unbind-key.c Sync OpenBSD patchset 614: 2010-01-25 17:12:44 +00:00
cmd-unlink-window.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
cmd.c Sync OpenBSD patchset 735: 2010-07-17 14:38:13 +00:00
colour.c Sync OpenBSD patchset 322: 2009-09-11 14:13:52 +00:00
compat.h imsg was moved into libutil on OpenBSD. 2010-06-06 13:00:47 +00:00
configure imsg was moved into libutil on OpenBSD. 2010-06-06 13:00:47 +00:00
environ.c Run job commands explicitly in the global enviroment (which can be 2010-04-06 21:59:19 +00:00
FAQ How to blank on lock, from Thomas Adam, slightly tweaked by me. 2010-07-31 11:46:28 +00:00
GNUmakefile Working on 1.4. 2010-07-18 14:53:27 +00:00
grid-utf8.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
grid-view.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
grid.c Merge output (more) and copy modes into one single mode (called copy). 2010-04-05 05:11:44 +00:00
input-keys.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
input.c Sync OpenBSD patchset 683: 2010-04-18 15:11:47 +00:00
job.c Sync OpenBSD patchset 696: 2010-05-14 14:30:01 +00:00
key-bindings.c Sync OpenBSD patchset 727: 2010-07-02 02:43:01 +00:00
key-string.c Use a macro-based mask for obtaining a key or modifier-set from the combination. 2010-06-05 20:29:11 +00:00
layout-custom.c Sync OpenBSD patchset 732: 2010-07-02 02:54:52 +00:00
layout-set.c Sync OpenBSD patchset 688: 2010-05-14 14:16:37 +00:00
layout-string.c Sync OpenBSD patchset 732: 2010-07-02 02:54:52 +00:00
layout.c Sync OpenBSD patchset 732: 2010-07-02 02:54:52 +00:00
log.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
Makefile Working on 1.4. 2010-07-18 14:53:27 +00:00
mode-key.c Jump-forward, jump-backward in copy mode, based on vi's F and f commands. 2010-03-16 17:30:58 +00:00
names.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00
NOTES Update CHANGES, and NOTES for the 1.2 release. 2010-03-10 15:18:11 +00:00
options.c Sync OpenBSD patchset 343: 2009-09-22 14:22:21 +00:00
osdep-darwin.c Space trimmage mega-diff. 2009-05-04 17:58:27 +00:00
osdep-freebsd.c Nuke dead variable here as well, in accordance to OpenBSD patchset 235. 2009-08-09 18:00:45 +00:00
osdep-linux.c Apply the make magic wand to pick an osdep-*.c file rather than using ifdefs. 2009-04-29 23:07:35 +00:00
osdep-netbsd.c Should be bestp now. 2009-09-24 12:30:22 +00:00
osdep-openbsd.c Sync OpenBSD patchset 592: 2009-12-26 23:48:37 +00:00
osdep-sunos.c Fill in the tty name in SunOS's forkpty compat, and use it in osdep_getname. 2009-10-15 07:11:25 +00:00
osdep-unknown.c Apply the make magic wand to pick an osdep-*.c file rather than using ifdefs. 2009-04-29 23:07:35 +00:00
paste.c Nuke vis.h. 2010-06-22 23:36:54 +00:00
resize.c Sync OpenBSD patchset 724: 2010-06-22 23:26:18 +00:00
screen-redraw.c Sync OpenBSD patchset 632: 2010-02-05 01:31:06 +00:00
screen-write.c Ensure we overwrite wide characters properly, and never overwrite characters we weren't overlapping. 2010-06-16 18:09:23 +00:00
screen.c Solaris has MAXHOSTNAMELEN in netdb.h. 2010-07-19 18:31:42 +00:00
server-client.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
server-fn.c Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
server-window.c Sync OpenBSD patchset 738: 2010-07-20 17:36:41 +00:00
server.c Sync OpenBSD patchset 722: 2010-06-22 23:21:39 +00:00
session.c Sync OpenBSD patchset 730: 2010-07-02 02:49:19 +00:00
signal.c Sync OpenBSD patchset 698: 2010-05-14 14:35:26 +00:00
status.c Sync OpenBSD patchset 724: 2010-06-22 23:26:18 +00:00
tmux.1 Sync OpenBSD patchset 736: 2010-07-17 14:39:01 +00:00
tmux.c Sync OpenBSD patchset 734: 2010-07-17 14:36:41 +00:00
tmux.h Sync OpenBSD patchset 741: 2010-08-09 21:44:25 +00:00
TODO Done. 2010-07-18 13:39:02 +00:00
tty-keys.c Sync OpenBSD patchset 710: 2010-06-06 00:23:44 +00:00
tty-term.c FreeBSD 6.x has a bug and crashes in del_curterm, so ifdef it out on that 2009-12-18 07:42:30 +00:00
tty.c Sync OpenBSD patchset 716: 2010-06-06 00:30:34 +00:00
utf8.c Sync OpenBSD patchset 424: 2009-10-23 17:21:34 +00:00
window-choose.c Pass in the session, rather than the client, to window modes' key() function. 2010-05-22 21:56:04 +00:00
window-clock.c Pass in the session, rather than the client, to window modes' key() function. 2010-05-22 21:56:04 +00:00
window-copy.c Don't enable/disable invalid event pointers. Fixes SF #3033119. 2010-07-22 19:51:48 +00:00
window.c Sync OpenBSD patchset 735: 2010-07-17 14:38:13 +00:00
xmalloc.c Sync OpenBSD patchset 467: 2009-10-28 23:12:38 +00:00
xterm-keys.c Sync OpenBSD patchset 581: 2009-12-04 22:14:47 +00:00