Commit Graph

4908 Commits

Author SHA1 Message Date
Nicholas Marriott
f42364b4b5 How to blank on lock, from Thomas Adam, slightly tweaked by me. 2010-07-31 11:46:28 +00:00
Nicholas Marriott
5be8175b0b No more up-pane/down-pane. 2010-07-31 11:39:13 +00:00
Nicholas Marriott
77f9c49829 dup() the stdin fd so it isn't closed twice (once for stdin, once for tty). 2010-07-28 22:15:15 +00:00
Tiago Cunha
5576fe42b2 Sync with reality, per SF bug #3035214. 2010-07-27 18:29:07 +00:00
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
bf09b00fe9 kqueue(2) is currently broken when used with /dev/null and a few other
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-07-24 19:25:31 +00:00
Nicholas Marriott
a97b7ad11c Fix a crash: if remain-on-exit is set and the pane has exited, the
buffers may not be valid, so do not try to disable/enable them when
switching to copy mode.
2010-07-22 21:10:51 +00:00
Micah Cowan
1944747759 Don't enable/disable invalid event pointers. Fixes SF #3033119. 2010-07-22 19:51:48 +00:00
Tiago Cunha
28c4c86589 Sync OpenBSD patchset 738:
Don't return if in the current window since we may want to report a bell
(if bell-action any/current), just clear the flag so the status line
doesn't show the bell.
2010-07-20 17:36:41 +00:00
Tiago Cunha
7ed9b0f8fb Sync OpenBSD patchset 737:
Send the \n to stdout with the message, not stderr... doh.
2010-07-20 17:36:03 +00:00
Nicholas Marriott
2b80ede963 Don't return if in the current window since we may want to report a bell
(if bell-action any/current), just clear the flag so the status line
doesn't show the bell.
2010-07-19 21:13:03 +00:00
Nicholas Marriott
11497af4dd Solaris has MAXHOSTNAMELEN in netdb.h. 2010-07-19 18:31:42 +00:00
Nicholas Marriott
2a0f3f0d79 Send the \n to stdout with the message, not stderr... doh. 2010-07-19 18:27:38 +00:00
Tiago Cunha
b0878774e0 Don't hard-code the username. 2010-07-19 13:57:22 +00:00
Tiago Cunha
e71f0842ce Working on 1.4. 2010-07-18 14:53:27 +00:00
Tiago Cunha
9b47a48393 Changes for 1.3. 2010-07-18 13:40:59 +00:00
Tiago Cunha
0482983d53 Done. 2010-07-18 13:39:02 +00:00
Tiago Cunha
2b512dc49d Bump VERSION, and comment FDEBUG. 2010-07-18 13:36:52 +00:00
Tiago Cunha
ae45c2ea45 Sync OpenBSD patchset 736:
some escapes i missed;
2010-07-17 14:39:01 +00:00
Tiago Cunha
11f81e8134 Sync OpenBSD patchset 735:
Make pane/window wrapping more logical (so with 10 windows, +10 from
window 5 stays in the same place), and tidy the code. From Tiago Cunha.
2010-07-17 14:38:13 +00:00
Tiago Cunha
ad6a528f61 Sync OpenBSD patchset 734:
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-17 14:36:41 +00:00
Jason McIntyre
a471b5de9c some escapes i missed; 2010-07-15 21:54:20 +00:00
Nicholas Marriott
43355fa75c Make pane/window wrapping more logical (so with 10 windows, +10 from
window 5 stays in the same place), and tidy the code. From Tiago Cunha.
2010-07-14 18:37:49 +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
Tiago Cunha
46f27eab22 Sync OpenBSD patchset 733:
replace some magic mouse constants with defines for clarity. ok nicm
2010-07-02 02:56:07 +00:00
Tiago Cunha
e4703bacb5 Sync OpenBSD patchset 732:
Custom layouts. list-windows command displays the layout as a string (such as
"bb62,159x48,0,0{79x48,0,0,79x48,80,0}") and it can be applied to another
window (with the same number of panes or fewer) using select-layout.
2010-07-02 02:54:52 +00:00
Tiago Cunha
e4573de97b Sync OpenBSD patchset 731:
Send all three of stdin, stdout, stderr from the client to the server, so that
commands can directly make use of them. This means that load-buffer and
save-buffer can have "-" as the file to read from stdin or write to stdout.

This is a protocol version bump so the tmux server will need to be restarted
after upgrade (or an older client used).
2010-07-02 02:52:13 +00:00
Tiago Cunha
63e76b555d Sync OpenBSD patchset 730:
Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is
used.
2010-07-02 02:49:19 +00:00
Tiago Cunha
13e7f060b1 Update. 2010-07-02 02:46:39 +00:00
Tiago Cunha
fa34c76275 Sync OpenBSD patchset 729:
New option, detach-on-destroy, to set what happens to a client when the session
it is attached to is destroyed. If on (the default), it is detached; if off, it
is switched to the most recently active session.
2010-07-02 02:45:52 +00:00
Tiago Cunha
985cd3a4de Sync OpenBSD patchset 728:
Use server_destroy_session() for kill-session.
2010-07-02 02:43:50 +00:00
Tiago Cunha
03c1c1cd9f Sync OpenBSD patchset 727:
Setting the cmdlist pointer in the bind-key to NULL to prevent it being freed
after the command is executing is bogus because it may still be needed if the
same command is going to be executed again (for example if you "bind-key a
bind-key b ..."). Making a copy is hard, so instead add a reference count to
the cmd_list.

While here, also print bind-key -n and the rest of the flags properly.

Fixes problem reported by mcbride@.
2010-07-02 02:43:01 +00:00
Ted Unangst
b4b9b831ee replace some magic mouse constants with defines for clarity. ok nicm 2010-06-29 05:24:49 +00:00
Nicholas Marriott
552c9cd83f Custom layouts. list-windows command displays the layout as a string (such as
"bb62,159x48,0,0{79x48,0,0,79x48,80,0}") and it can be applied to another
window (with the same number of panes or fewer) using select-layout.
2010-06-29 03:30:13 +00:00
Nicholas Marriott
76bbdeb586 Send all three of stdin, stdout, stderr from the client to the server, so that
commands can directly make use of them. This means that load-buffer and
save-buffer can have "-" as the file to read from stdin or write to stdout.

This is a protocol version bump so the tmux server will need to be restarted
after upgrade (or an older client used).
2010-06-28 22:10:42 +00:00
Nicholas Marriott
07a71fd432 Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is
used.
2010-06-27 02:56:59 +00:00
Nicholas Marriott
26524c99f6 New option, detach-on-destroy, to set what happens to a client when the session
it is attached to is destroyed. If on (the default), it is detached; if off, it
is switched to the most recently active session.
2010-06-27 00:22:22 +00:00
Nicholas Marriott
34464da8d3 Use server_destroy_session() for kill-session. 2010-06-26 23:55:50 +00:00
Nicholas Marriott
42e2413978 Setting the cmdlist pointer in the bind-key to NULL to prevent it being freed
after the command is executing is bogus because it may still be needed if the
same command is going to be executed again (for example if you "bind-key a
bind-key b ..."). Making a copy is hard, so instead add a reference count to
the cmd_list.

While here, also print bind-key -n and the rest of the flags properly.

Fixes problem reported by mcbride@.
2010-06-26 18:20:53 +00:00
Tiago Cunha
0e70c8801c Update. 2010-06-22 23:37:28 +00:00
Tiago Cunha
617386370b Nuke vis.h. 2010-06-22 23:36:54 +00:00
Tiago Cunha
bf1e237410 Sync OpenBSD patchset 726:
Add a choose-buffer command for easier use of the paste buffer stack.
2010-06-22 23:35:20 +00:00
Tiago Cunha
8d3b726396 Sync OpenBSD patchset 725:
Extend the -t:+ and -t:- window targets for next and previous window to
accept an offset such as -t:+2. From Tiago Cunha.
2010-06-22 23:29:05 +00:00
Tiago Cunha
47b335dee7 Sync OpenBSD patchset 724:
Having a list of winlinks->alerts for each session is stupid, just store
the alert flags directly in the winlink itself.
2010-06-22 23:26:18 +00:00
Tiago Cunha
6c76724201 Sync OpenBSD patchset 723:
Rename activity->alert in a couple of functions for consistency.
2010-06-22 23:22:31 +00:00
Tiago Cunha
29434cb043 Sync OpenBSD patchset 722:
Give tmux sockets (but not the containing folder) group
permissions. This allows hardlinks to the sockets to be used more
easily.
2010-06-22 23:21:39 +00:00
Nicholas Marriott
ef7293379f Add a choose-buffer command for easier use of the paste buffer stack. 2010-06-21 21:44:09 +00:00
Nicholas Marriott
386849edc1 Extend the -t:+ and -t:- window targets for next and previous window to
accept an offset such as -t:+2. From Tiago Cunha.
2010-06-21 01:46:36 +00:00
Nicholas Marriott
e63f0546a1 Having a list of winlinks->alerts for each session is stupid, just store
the alert flags directly in the winlink itself.
2010-06-21 01:27:46 +00:00
Nicholas Marriott
447a07e9f8 Rename activity->alert in a couple of functions for consistency. 2010-06-21 00:25:32 +00:00