The branch, hooks has been updated
via d89c2e4a6068ff407baa20c3ef0cbae2d691bfd1 (commit)
via 14872ac114b88a5f4971bc04ebf959fb654348ae (commit)
via dc2adc6bc1f1b2dc25252ff9703fe5b3fe4d8786 (commit)
via 7981e653d805fd3fa31cf7897704b3a328edf0f2 (commit)
via bc9198072b80853375bfc77e0cb72866b92273b0 (commit)
via e88c48ce0e80d896ff2cc9c01401e377c1e46e14 (commit)
via f54f3e2abe6266a4c8b335ec2a83ebc1c2cdd1a5 (commit)
via bb210ce77354b168a82fb8e760fb82732656a227 (commit)
via 771744426e3cd3fbf746e5c9554b8119e5f6faf2 (commit)
via 3eb40a520a3965b4eaed063891a91f890703c1ba (commit)
via 7d98c51805b6d1c6996b4bc6a68107d4e6bb0038 (commit)
via c2bc84aa4dd30c46930994321de0541edf6a30e9 (commit)
via b7777e7ef37a6a5b9a231602c1ac66a307ae23db (commit)
via 91f6347485a2efe714cf0bc50e4d1fbc2a33c01e (commit)
via 94a8ef1caef855d1a43b6373dd08ce0bbf4aadd5 (commit)
via 95195f52584565483bf9850840f6d81cd88bf9b2 (commit)
via a70762c9b50e9d9249fa9a56233c0df4129c82fc (commit)
via 5bd5c9c84e4bde3461a50f15e387c5e9fb78d7cb (commit)
via 72e9ebf2ece28c986050162bf4f401a6a7679f53 (commit)
via 05e7fbd60fcd1f5c82049dc2f416e7dd42577cfd (commit)
via 1d1208e335644ee10ebe47363b2ca8db45bf9142 (commit)
via a568b9cadce002f6f7e8ee914c995242bd70cce5 (commit)
via 07dfdb974d36f1eee084b9739d2b8a5b64172ec8 (commit)
via 6dbd63ba4f2da666d55267692c610b9ed8d1d8dd (commit)
via d23af6cca0c4d55097d567bbfea42aecf0ca36b0 (commit)
via 56e1132db485aeb0730ce7782533ca441e63afef (commit)
via aeedb464a6ee038289ddcfefae437928ab020cb1 (commit)
via 583b4ab72b7bf66fda8ab63a08fe435483de5e5a (commit)
via 5a2d0533a84a13613fb356b66ed8ada2a65f6edf (commit)
via a5a873dcccaabd55dbb0ad32abafbf1049316392 (commit)
via ab73997cc5bd652370beef93db5fca439448734a (commit)
via 9a453dd3546b2c3053e8e34bf4d6775b1a05d3a8 (commit)
via 8d66f4fba4972d45be64d108c7c8d952f85016a8 (commit)
via 89e80cabd56bf2f7fa783575fe9b1f6192fade42 (commit)
via 0a88377086329786c438d4973365fdb21186f4e4 (commit)
via 3909aff06aa6de748ae057cab1e723eec2387edd (commit)
via 69f292a90e2fb9d48a77a9753127da13554715de (commit)
via 93b2871cab399388a16ace64d8dfb9a8e2143543 (commit)
via 7a72eff4a4717e975ab7ef39baff5667b12e8a13 (commit)
via d16b640fe8583878d23436bd7515a8adade9faeb (commit)
via 0e7219d437ce565a518b336a5db112eaeaeddc5c (commit)
via d1337053b6119c4aab0c38b5fc082acf2fdfcbb1 (commit)
via 4cf4302962558be4d5e7a87c57f084d1187fa330 (commit)
via 1f404f6a23969516007c77eeec89876154c9a4a4 (commit)
via bc3786ece940dc9c68f731734b45c129e0542ac7 (commit)
via 0610f443808cc284171a4abc14bd3f95a9f3a57b (commit)
via 07d93db427751512e6ae96a54e69846189da2dc2 (commit)
via bded7437064c76dd6cf4e76e558d826859adcc79 (commit)
via 3497843f0272e573d0a63cb6e94948591ae07667 (commit)
via b25dc423b0b1369aaec5dee8e051d541bd55043f (commit)
via 0fd9a97202dc2878d9cf21f3bea01b599c21e61b (commit)
via 6f587570ed8c0e2db8bd4e676f4363b0824beb5f (commit)
via acb8248ba64e1c9770d39d9790439c74eb9e5d80 (commit)
via 8101f1ef16d2f163dde885a42ef5480ff2562e43 (commit)
via bbac2aee1fe16b1ff67b0e2dd8faada68e157a5e (commit)
via bf635e7741f7b881f67ec7e4a5caa02f7ff3d786 (commit)
via ee123c248951450100475717f5bd45f292d9bb4d (commit)
via 24c8f523eb8b294d057d617bc27cfbd2a4773f19 (commit)
via aaad44bbe7ed7ff258598e38dce8cf62ae8ff658 (commit)
via 370cf75458e7736920559870d8ccff1d4bcee755 (commit)
via 4a7587931ce54aa1a94a104480113d658c295b6b (commit)
via eec27f9257976d063db279594bff264c2e32d52c (commit)
via f922920609063ff5ac1ee11a48bf8f1bd13e8d16 (commit)
via 0cd55eb1e7823a75810b7f43f53b6266cb8b0bc0 (commit)
via 009a5e4213a04555be0fb654f80fe8685082ba20 (commit)
via 6920be311b276277ad7c38a96ccca4746b94bd95 (commit)
via 3aa72b42b2a317b0ae531219d269f2a636d6482a (commit)
via 02df86079b1f3155313ebb6f891cf6cf593d3ad9 (commit)
via 5e956f114819294e03166e6c66128feb6e0571a2 (commit)
via cd9ccbc1e98b48fd8bfb64356664313a8eb1f7b0 (commit)
via 7536d690fdb8859193cdfdd2f68752711425bdd0 (commit)
via b8aec17af16ca557a3069a475d31a90d2925fe11 (commit)
via f4196138cefe01df9aed085a7534dc30f45999e8 (commit)
via fe1aa9299eb84e89dc5009997b46e0c3bc000e45 (commit)
via 568f5ef3c6263004c5f6f1278346e18c66d02be3 (commit)
via bafe6f5a7c8b09a62ac2ab2444aa04fb5736c8a5 (commit)
via be6dc83277c49c8f7db30cc363134463af0aa596 (commit)
via c2bbaab2ac06420fa56c872294a9f8d7b326571e (commit)
via ffb83d23e17e99589f46edc3e08f78dd32936e4e (commit)
via 4d05d8830482f8d5b5f812d082f1332090fcf027 (commit)
via 9ae2284726a8fd37f73cf98b6e78dd7540e023af (commit)
via b4750e4c352f70ce515bed1279d8561a288f1f1b (commit)
via 1b2c62afe9ba0e52bbbcf002d5c4992976d6b4ec (commit)
via f28032b03127557377a75d12457fd9a0222843bb (commit)
via 52756fb3c5376e8f59607de328f92f7f681d3972 (commit)
via cb018a421265de2f488a741530686589ab6b262f (commit)
via 833fe5bdee449b04afe8844774be66374e1baf9c (commit)
via 313f2263f8bb3336893527f65789f820ba7eaf0f (commit)
via 8d94bb67abe0e83571bc5c0875755a40ea9c9039 (commit)
via 03758a50dc21b7c77b75f689d06f81292266c20a (commit)
via 83a8e1fd20e3cbd6da38d0b4d6973cad0484c27b (commit)
via 90bf7026f6bb83e0781ff2fc71c32ce973edce59 (commit)
via f1e68bfdd22dc1fa13630cb64855506643e01c5c (commit)
via 4946f74253de52f10beb023d4c5b88bafdb11ec4 (commit)
via e5d9ceff18e37320b9243d24204a0a79d77172e4 (commit)
via c9642ee21367f0bf2b17b423d7155c88138aa9fc (commit)
via 4e03239d1f2edc4f2d9f90c2bb28d609b64ea566 (commit)
via 144025e3e6ecd5503326a674de70075851e54a85 (commit)
via adcc71d4d5d338d0f7d13867e59a11741eb36afa (commit)
via c38f0d85da44d83ea69c6586a1aef428d9f489d0 (commit)
via f9c7f9a17aaf05f4303f66982f6cf33ad03f9714 (commit)
via 16bdd970dcc68e50f26c512b3ead628b9b899c88 (commit)
via d45150267656530b8503375555a1814fcfe6a15a (commit)
from 731c0403d586cc41f002082334f7001284c6ba60 (commit)
- Log -----------------------------------------------------------------
commit d89c2e4a6068ff407baa20c3ef0cbae2d691bfd1
Author: Thomas Adam <[email protected]>
Commit: Thomas Adam <[email protected]>
Moar
---
cmd-attach-session.c | 7 +----
cmd.c | 62 ++++++++++++++++++++++++++++++++++++++++++++-----
notify.c | 6 +---
3 files changed, 59 insertions(+), 16 deletions(-)
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index 9d7b83a..32399f9 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -45,7 +45,7 @@ enum cmd_retval
cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char *cflag)
{
struct session *s = cmdq->state.tflag.s;
- struct client *cloop, *c = cmdq->state.c;
+ struct client *c = cmdq->state.c;
struct winlink *wl = cmdq->state.tflag.wl;
struct window_pane *wp = cmdq->state.tflag.wp;
const char *update;
@@ -70,10 +70,7 @@ cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag,
const char *cflag)
if (cflag != NULL) {
ft = format_create();
- format_client(ft, c);
- format_session(ft, s);
- format_winlink(ft, s, s->curw);
- format_window_pane(ft, s->curw->window->active);
+ format_defaults(ft, c, s, wl, wp);
cp = format_expand(ft, cflag);
format_free(ft);
diff --git a/cmd.c b/cmd.c
index 130d90c..fdb2184 100644
--- a/cmd.c
+++ b/cmd.c
@@ -336,7 +336,7 @@ cmd_get_state_client(struct cmd_q *cmdq, int quiet)
switch (cmd->entry->flags & (CMD_PREP_CLIENT_C|CMD_PREP_CLIENT_T)) {
case 0:
- return (cmd_current_client(cmdq));
+ return (cmd_find_client(cmdq, NULL, 1));
case CMD_PREP_CLIENT_C:
return (cmd_find_client(cmdq, args_get(args, 'c'), quiet));
case CMD_PREP_CLIENT_T:
@@ -394,9 +394,9 @@ cmd_set_state_tflag(struct cmd *cmd, struct cmd_q *cmdq)
return (-1);
s = state->tflag.s;
- if ((w = cmd_lookup_windowid(tflag)) != NULL)
+ if ((w = window_find_by_id_str(tflag)) != NULL)
wp = w->active;
- else if ((wp = cmd_lookup_paneid(tflag)) != NULL)
+ else if ((wp = window_pane_find_by_id_str(tflag)) !=
NULL)
w = wp->window;
wl = winlink_find_by_window(&s->windows, w);
if (wl != NULL) {
@@ -451,7 +451,7 @@ complete_everything:
if (state->c != NULL)
state->tflag.s = state->c->session;
if (state->tflag.s == NULL)
- state->tflag.s = cmd_current_session(cmdq, prefer);
+ state->tflag.s = cmd_find_current(cmdq);
if (state->tflag.s == NULL) {
if (flags & CMD_PREP_CANFAIL)
return (0);
@@ -518,9 +518,9 @@ cmd_set_state_sflag(struct cmd *cmd, struct cmd_q *cmdq)
return (-1);
s = state->sflag.s;
- if ((w = cmd_lookup_windowid(sflag)) != NULL)
+ if ((w = window_find_by_id_str(sflag)) != NULL)
wp = w->active;
- else if ((wp = cmd_lookup_paneid(sflag)) != NULL)
+ else if ((wp = window_pane_find_by_id_str(sflag)) !=
NULL)
w = wp->window;
wl = winlink_find_by_window(&s->windows, w);
if (wl != NULL) {
@@ -568,7 +568,7 @@ complete_everything:
state->sflag.s = state->c->session;
if (state->sflag.s == NULL)
- state->sflag.s = cmd_current_session(cmdq, prefer);
+ state->sflag.s = cmd_find_current(cmdq);
if (state->sflag.s == NULL) {
if (flags & CMD_PREP_CANFAIL)
@@ -674,6 +674,54 @@ cmd_has_session_alert(struct session *s, struct alert **al)
return (0);
}
+/* Adjust current mouse position for a pane. */
+int
+cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
+ u_int *yp, int last)
+{
+ u_int x, y;
+
+ if (last) {
+ x = m->lx;
+ y = m->ly;
+ } else {
+ x = m->x;
+ y = m->y;
+ }
+
+ if (m->statusat == 0 && y > 0)
+ y--;
+ else if (m->statusat > 0 && y >= (u_int)m->statusat)
+ y = m->statusat - 1;
+
+ if (x < wp->xoff || x >= wp->xoff + wp->sx)
+ return (-1);
+ if (y < wp->yoff || y >= wp->yoff + wp->sy)
+ return (-1);
+
+ *xp = x - wp->xoff;
+ *yp = y - wp->yoff;
+ return (0);
+}
+
+/* Get current mouse window if any. */
+struct winlink *
+cmd_mouse_window(struct mouse_event *m, struct session **sp)
+{
+ struct session *s;
+ struct window *w;
+
+ if (!m->valid || m->s == -1 || m->w == -1)
+ return (NULL);
+ if ((s = session_find_by_id(m->s)) == NULL)
+ return (NULL);
+ if ((w = window_find_by_id(m->w)) == NULL)
+ return (NULL);
+
+ if (sp != NULL)
+ *sp = s;
+ return (winlink_find_by_window(&s->windows, w));
+}
/* Get current mouse pane if any. */
struct window_pane *
diff --git a/notify.c b/notify.c
index efa776a..f6add06 100644
--- a/notify.c
+++ b/notify.c
@@ -135,15 +135,13 @@ notify_drain(void)
{
struct notify_entry *ne, *ne1;
struct client *c = NULL, *cloop = NULL;
- u_int i;
if (notify_disabled)
return;
/* If no clients want notifications, stop here! */
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- cloop = ARRAY_ITEM(&clients, i);
- if (!CONTROL_SHOULD_NOTIFY_CLIENT(cloop))
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;
c = cloop;
}
commit 14872ac114b88a5f4971bc04ebf959fb654348ae
Merge: 731c040 dc2adc6
Author: Thomas Adam <[email protected]>
Commit: Thomas Adam <[email protected]>
WIP: BROKEN AND NEEDS FIXINGmakemake
Makefile.am | 3 +-
TODO | 18 +-
cfg.c | 51 ++-
client.c | 21 +-
cmd-attach-session.c | 30 +-
cmd-bind-key.c | 44 ++-
cmd-break-pane.c | 6 +-
cmd-capture-pane.c | 2 +-
cmd-choose-buffer.c | 2 +-
cmd-choose-client.c | 27 +-
cmd-clock-mode.c | 43 --
cmd-command-prompt.c | 2 +-
cmd-confirm-before.c | 2 +-
cmd-copy-mode.c | 34 ++-
cmd-detach-client.c | 40 +-
cmd-display-message.c | 6 +-
cmd-find-window.c | 4 +-
cmd-find.c | 1117 ++++++++++++++++++++++++++++++++++++++++++++
cmd-if-shell.c | 52 ++-
cmd-list-buffers.c | 2 +-
cmd-list-clients.c | 18 +-
cmd-list-keys.c | 86 ++--
cmd-list-panes.c | 4 +-
cmd-list-sessions.c | 2 +-
cmd-list-windows.c | 4 +-
cmd-load-buffer.c | 2 +-
cmd-move-window.c | 18 +-
cmd-new-session.c | 5 +-
cmd-new-window.c | 10 +-
cmd-pipe-pane.c | 20 +-
cmd-queue.c | 28 +-
cmd-resize-pane.c | 66 +++-
cmd-respawn-pane.c | 2 +-
cmd-run-shell.c | 19 +-
cmd-save-buffer.c | 2 +-
cmd-select-layout.c | 68 ++-
cmd-select-pane.c | 38 ++-
cmd-send-keys.c | 21 +-
cmd-set-option.c | 52 ++-
cmd-show-messages.c | 5 +-
cmd-split-window.c | 18 +-
cmd-switch-client.c | 22 +-
cmd-unbind-key.c | 37 +-
cmd.c | 994 +--------------------------------------
colour.c | 18 +-
compat/getopt.c | 4 +-
configure.ac | 2 +
control-notify.c | 30 +-
control.c | 2 +-
environ.c | 7 +-
format.c | 154 +++++--
grid.c | 2 +-
input-keys.c | 98 ++--
input.c | 14 +-
job.c | 5 +-
key-bindings.c | 129 ++++--
key-string.c | 17 +-
layout-custom.c | 4 +-
layout.c | 52 --
logo/LICENSE | 13 +
logo/favicon.ico | Bin 0 -> 6518 bytes
logo/tmux-logo-1-color.eps | 922 ++++++++++++++++++++++++++++++++++++
logo/tmux-logo-1-color.svg | 18 +
logo/tmux-logo-huge.png | Bin 0 -> 47121 bytes
logo/tmux-logo-large.png | Bin 0 -> 12190 bytes
logo/tmux-logo-medium.png | Bin 0 -> 5400 bytes
logo/tmux-logo-small.png | Bin 0 -> 2701 bytes
logo/tmux-logo.eps | 925 ++++++++++++++++++++++++++++++++++++
logo/tmux-logo.svg | 18 +
logo/tmux-logomark.eps | 829 ++++++++++++++++++++++++++++++++
logo/tmux-logomark.svg | 15 +
mode-key.c | 14 +
names.c | 4 +-
notify.c | 6 +-
options-table.c | 101 ++---
options.c | 18 +-
paste.c | 6 +-
resize.c | 14 +-
screen-redraw.c | 22 +-
server-client.c | 550 ++++++++++++++--------
server-fn.c | 73 +--
server-window.c | 60 +--
server.c | 117 ++---
session.c | 22 +-
status.c | 140 +++---
style.c | 38 +-
tmux.1 | 494 +++++++++++++-------
tmux.c | 5 +-
tmux.h | 257 ++++++----
tty-keys.c | 81 +---
tty-term.c | 2 +
tty.c | 236 +++++++---
utf8.c | 4 +-
window-choose.c | 115 ++---
window-clock.c | 8 +-
window-copy.c | 252 +++++-----
window.c | 240 +++++-----
www/favicon.ico | Bin 0 -> 6518 bytes
www/index.html.in | 2 +-
www/logo.png | Bin 0 -> 2701 bytes
www/main.css | 5 +
101 files changed, 6423 insertions(+), 2788 deletions(-)
diff --cc TODO
index e7ecec6,34b6cfe..eb2d2dc
--- a/TODO
+++ b/TODO
@@@ -60,8 -82,10 +60,9 @@@
- copy/paste improvements:
* incremental searching
- * append to buffer
* paste w/o trailing whitespace
* command to toggle selection not to move it in copy-mode
+ * regex searching
- layout stuff
* way to tag a layout as a number/name
diff --cc cmd-attach-session.c
index c0dd9e3,46d568b..9d7b83a
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@@ -42,15 -41,16 +42,14 @@@ const struct cmd_entry cmd_attach_sessi
};
enum cmd_retval
-cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int
rflag,
- const char *cflag)
+cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char
*cflag)
{
- struct session *s;
- struct client *c;
- struct winlink *wl = NULL;
- struct window *w = NULL;
- struct window_pane *wp = NULL;
+ struct session *s = cmdq->state.tflag.s;
+ struct client *cloop, *c = cmdq->state.c;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window_pane *wp = cmdq->state.tflag.wp;
const char *update;
char *cause;
- u_int i;
int fd;
struct format_tree *ft;
char *cp;
@@@ -95,17 -94,33 +94,30 @@@
* Can't use server_write_session in case attaching to
* the same session as currently attached to.
*/
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- cloop = ARRAY_ITEM(&clients, i);
- if (cloop == NULL || cloop->session != s)
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (c->session != s || c == cmdq->client)
continue;
- if (cloop == cmdq->client)
- continue;
- server_write_client(cloop, MSG_DETACH,
- cloop->session->name,
- strlen(cloop->session->name) + 1);
+ server_write_client(c, MSG_DETACH,
+ c->session->name,
+ strlen(c->session->name) + 1);
+ }
+ }
+
+ if (cflag != NULL) {
+ ft = format_create();
+ format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s,
+ NULL, NULL);
+ cp = format_expand(ft, cflag);
+ format_free(ft);
+
+ fd = open(cp, O_RDONLY|O_DIRECTORY);
+ free(cp);
+ if (fd == -1) {
+ cmdq_error(cmdq, "bad working directory: %s",
+ strerror(errno));
+ return (CMD_RETURN_ERROR);
}
- close(s->cwd);
- s->cwd = fd;
}
-
cmdq->client->session = s;
notify_attached_session_changed(cmdq->client);
session_update_activity(s);
diff --cc cmd-break-pane.c
index 1de3dbe,a1da0a3..436c260
--- a/cmd-break-pane.c
+++ b/cmd-break-pane.c
@@@ -85,11 -89,7 +85,7 @@@ cmd_break_pane_exec(struct cmd *self, s
template = BREAK_PANE_TEMPLATE;
ft = format_create();
- if (cmdq->state.c != NULL)
- format_client(ft, cmdq->state.c);
- format_session(ft, s);
- format_winlink(ft, s, wl);
- format_window_pane(ft, wp);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl, wp);
++ format_defaults(ft, cmdq->state.c, s, wl, wp);
cp = format_expand(ft, template);
cmdq_print(cmdq, "%s", cp);
diff --cc cmd-choose-client.c
index c56ee4b,93ac28a..46569bd
--- a/cmd-choose-client.c
+++ b/cmd-choose-client.c
@@@ -53,15 -53,15 +53,15 @@@ enum cmd_retva
cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct client *c;
+ struct client *c = cmdq->state.c;
struct client *c1;
struct window_choose_data *cdata;
- struct winlink *wl;
+ struct winlink *wl = cmdq->state.tflag.wl;
const char *template;
char *action;
- u_int i, idx, cur;
+ u_int idx, cur;
- if ((c = cmd_find_client(cmdq, NULL, 1)) == NULL) {
+ if (c == NULL) {
cmdq_error(cmdq, "no client available");
return (CMD_RETURN_ERROR);
}
diff --cc cmd-copy-mode.c
index 9cf526c,d729ada..a3fe2e3
--- a/cmd-copy-mode.c
+++ b/cmd-copy-mode.c
@@@ -28,9 -28,9 +28,9 @@@ enum cmd_retval cmd_copy_mode_exec(str
const struct cmd_entry cmd_copy_mode_entry = {
"copy-mode", NULL,
- "t:u", 0, 0,
- "[-u] " CMD_TARGET_PANE_USAGE,
+ "Mt:u", 0, 0,
+ "[-Mu] " CMD_TARGET_PANE_USAGE,
- 0,
+ CMD_PREP_PANE_T,
cmd_copy_mode_exec
};
@@@ -37,8 -45,24 +45,23 @@@ const struct cmd_entry cmd_clock_mode_e
enum cmd_retval
cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq)
{
+ struct args *args = self->args;
+ struct client *c = cmdq->client;
+ struct session *s;
- struct window_pane *wp;
+ struct window_pane *wp = cmdq->state.tflag.wp;
+ if (args_has(args, 'M')) {
+ if ((wp = cmd_mouse_pane(&cmdq->item->mouse, &s, NULL)) == NULL)
+ return (CMD_RETURN_NORMAL);
+ if (c == NULL || c->session != s)
+ return (CMD_RETURN_NORMAL);
- } else if (cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp) == NULL)
- return (CMD_RETURN_ERROR);
++ }
+
+ if (self->entry == &cmd_clock_mode_entry) {
+ window_pane_set_mode(wp, &window_clock_mode);
+ return (CMD_RETURN_NORMAL);
+ }
+
if (wp->mode != &window_copy_mode) {
if (window_pane_set_mode(wp, &window_copy_mode) != 0)
return (CMD_RETURN_NORMAL);
diff --cc cmd-detach-client.c
index 174059e,4bae999..329d060
--- a/cmd-detach-client.c
+++ b/cmd-detach-client.c
@@@ -48,12 -48,13 +48,11 @@@ enum cmd_retva
cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct client *c = cmdq->state.c, *c2;
- struct client *c, *cloop;
++ struct client *c = cmdq->state.c, *cloop;
struct session *s;
enum msgtype msgtype;
- u_int i;
if (self->entry == &cmd_suspend_client_entry) {
- if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL)
- return (CMD_RETURN_ERROR);
tty_stop_tty(&c->tty);
c->flags |= CLIENT_SUSPENDED;
server_write_client(c, MSG_SUSPEND, NULL, 0);
@@@ -66,30 -67,36 +65,29 @@@
msgtype = MSG_DETACH;
if (args_has(args, 's')) {
- s = cmd_find_session(cmdq, args_get(args, 's'), 0);
- if (s == NULL)
- return (CMD_RETURN_ERROR);
-
+ s = cmdq->state.sflag.s;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session != s)
+ TAILQ_FOREACH(cloop, &clients, entry) {
+ if (cloop->session != s)
continue;
- server_write_client(c, msgtype, c->session->name,
- strlen(c->session->name) + 1);
+ server_write_client(cloop, msgtype,
+ cloop->session->name,
+ strlen(cloop->session->name) + 1);
}
- } else {
- if (args_has(args, 'a')) {
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c2 = ARRAY_ITEM(&clients, i);
- if (c2 == NULL || c2->session == NULL ||
- c2 == c)
- continue;
- server_write_client(c2, msgtype,
- c2->session->name,
- strlen(c2->session->name) + 1);
- }
- } else {
- server_write_client(c, msgtype, c->session->name,
- strlen(c->session->name) + 1);
+ return (CMD_RETURN_STOP);
+ }
+
- c = cmd_find_client(cmdq, args_get(args, 't'), 0);
- if (c == NULL)
- return (CMD_RETURN_ERROR);
-
+ if (args_has(args, 'a')) {
+ TAILQ_FOREACH(cloop, &clients, entry) {
+ if (cloop->session == NULL || cloop == c)
+ continue;
+ server_write_client(cloop, msgtype,
+ cloop->session->name,
+ strlen(cloop->session->name) + 1);
}
+ return (CMD_RETURN_NORMAL);
}
+ server_write_client(c, msgtype, c->session->name,
+ strlen(c->session->name) + 1);
return (CMD_RETURN_STOP);
}
diff --cc cmd-if-shell.c
index 41445a5,a307bd2..e0648d7
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@@ -58,18 -61,33 +61,22 @@@ cmd_if_shell_exec(struct cmd *self, str
struct cmd_if_shell_data *cdata;
char *shellcmd, *cmd, *cause;
struct cmd_list *cmdlist;
- struct client *c;
- struct session *s = NULL;
- struct winlink *wl = NULL;
- struct window_pane *wp = NULL;
+ struct session *s = cmdq->state.tflag.s;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window_pane *wp = cmdq->state.tflag.wp;
struct format_tree *ft;
+ int cwd;
+
- if (args_has(args, 't')) {
- wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
- cwd = wp->cwd;
- } else {
- c = cmd_find_client(cmdq, NULL, 1);
- if (c != NULL && c->session != NULL) {
- s = c->session;
- wl = s->curw;
- wp = wl->window->active;
- }
- if (cmdq->client != NULL && cmdq->client->session == NULL)
- cwd = cmdq->client->cwd;
- else if (s != NULL)
- cwd = s->cwd;
- else
- cwd = -1;
- }
++ cwd = wp->cwd;
++ if (cmdq->client != NULL && cmdq->client->session == NULL)
++ cwd = cmdq->client->cwd;
++ else if (s != NULL)
++ cwd = s->cwd;
++ else
++ cwd = -1;
ft = format_create();
- if (s != NULL)
- format_session(ft, s);
- if (s != NULL && wl != NULL)
- format_winlink(ft, s, wl);
- if (wp != NULL)
- format_window_pane(ft, wp);
+ format_defaults(ft, NULL, s, wl, wp);
shellcmd = format_expand(ft, args->argv[0]);
format_free(ft);
@@@ -139,10 -161,7 +150,8 @@@ cmd_if_shell_callback(struct job *job
return;
}
- cdata->started = 1;
-
cmdq1 = cmdq_new(cmdq->client);
+ cmdq1->flags |= cmdq->flags & CMD_Q_NOHOOKS;
cmdq1->emptyfn = cmd_if_shell_done;
cmdq1->data = cdata;
diff --cc cmd-list-clients.c
index 6182928,372b528..5064090
--- a/cmd-list-clients.c
+++ b/cmd-list-clients.c
@@@ -51,12 -51,14 +51,12 @@@ cmd_list_clients_exec(struct cmd *self
struct session *s;
struct format_tree *ft;
const char *template;
- u_int i;
+ u_int idx;
char *line;
- if (args_has(args, 't')) {
- s = cmd_find_session(cmdq, args_get(args, 't'), 0);
- if (s == NULL)
- return (CMD_RETURN_ERROR);
- } else
+ if (args_has(args, 't'))
+ s = cmdq->state.tflag.s;
+ else
s = NULL;
if ((template = args_get(args, 'F')) == NULL)
diff --cc cmd-move-window.c
index fb29298,e765b62..afd3e70
--- a/cmd-move-window.c
+++ b/cmd-move-window.c
@@@ -48,23 -48,32 +48,28 @@@ enum cmd_retva
cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct session *src, *dst, *s;
- struct winlink *wl;
+ struct session *src = cmdq->state.sflag.s;
+ struct session *dst = cmdq->state.tflag.s;
+ struct winlink *wl = cmdq->state.sflag.wl;
char *cause;
- int idx = cmdq->state.tflag.idx, kflag, dflag;
- int idx, kflag, dflag, sflag;
++ int idx = cmdq->state.tflag.idx, kflag, dflag, sflag;
- if (args_has(args, 'r')) {
- s = cmd_find_session(cmdq, args_get(args, 't'), 0);
- if (s == NULL)
- return (CMD_RETURN_ERROR);
+ kflag = args_has(self->args, 'k');
+ dflag = args_has(self->args, 'd');
- session_renumber_windows(s);
+ if (args_has(args, 'r')) {
+ session_renumber_windows(dst);
recalculate_sizes();
return (CMD_RETURN_NORMAL);
}
- if (server_link_window(src, wl, dst, idx, kflag, !dflag, &cause) != 0) {
- if ((wl = cmd_find_window(cmdq, args_get(args, 's'), &src)) == NULL)
- return (CMD_RETURN_ERROR);
- if ((idx = cmd_find_index(cmdq, args_get(args, 't'), &dst)) == -2)
- return (CMD_RETURN_ERROR);
-
+ kflag = args_has(self->args, 'k');
+ dflag = args_has(self->args, 'd');
+ sflag = args_has(self->args, 's');
++
+ if (server_link_window(src, wl, dst, idx, kflag, !dflag,
+ &cause) != 0) {
cmdq_error(cmdq, "can't link window: %s", cause);
free(cause);
return (CMD_RETURN_ERROR);
diff --cc cmd-new-session.c
index 087bfda,199e82c..2308f87
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@@ -121,7 -119,8 +121,7 @@@ cmd_new_session_exec(struct cmd *self,
/* Get the new session working directory. */
if (args_has(args, 'c')) {
ft = format_create();
- format_client(ft, c);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), NULL, NULL,
- NULL);
++ format_defaults(ft, c, NULL, NULL, NULL);
cp = format_expand(ft, args_get(args, 'c'));
format_free(ft);
@@@ -286,8 -287,8 +286,7 @@@
template = NEW_SESSION_TEMPLATE;
ft = format_create();
- format_client(ft, c);
- format_session(ft, s);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
- NULL);
++ format_defaults(ft, c, s, NULL, NULL);
cp = format_expand(ft, template);
cmdq_print(cmdq, "%s", cp);
diff --cc cmd-new-window.c
index 22e04d8,c05a0ce..68ce33f
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@@ -108,10 -108,8 +108,7 @@@ cmd_new_window_exec(struct cmd *self, s
if (args_has(args, 'c')) {
ft = format_create();
- format_client(ft, c);
- format_session(ft, s);
- format_winlink(ft, s, s->curw);
- format_window_pane(ft, s->curw->window->active);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
- NULL);
++ format_defaults(ft, c, s, NULL, NULL);
cp = format_expand(ft, args_get(args, 'c'));
format_free(ft);
@@@ -171,10 -169,8 +168,7 @@@
template = NEW_WINDOW_TEMPLATE;
ft = format_create();
- format_client(ft, c);
- format_session(ft, s);
- format_winlink(ft, s, wl);
- format_window_pane(ft, wl->window->active);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl,
- NULL);
++ format_defaults(ft, c, s, wl, NULL);
cp = format_expand(ft, template);
cmdq_print(cmdq, "%s", cp);
diff --cc cmd-pipe-pane.c
index 65db3da,49b156c..45c19be
--- a/cmd-pipe-pane.c
+++ b/cmd-pipe-pane.c
@@@ -47,11 -48,18 +48,14 @@@ enum cmd_retva
cmd_pipe_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct client *c;
- struct session *s;
- struct winlink *wl;
- struct window_pane *wp;
+ struct client *c = cmdq->state.c;
+ struct window_pane *wp = cmdq->state.tflag.wp;
- char *command;
++ struct session *s = cmdq->state.tflag.s;
++ struct winlink *wl = cmdq->state.tflag.wl;
+ char *cmd;
int old_fd, pipe_fd[2], null_fd;
+ struct format_tree *ft;
- if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp)) == NULL)
- return (CMD_RETURN_ERROR);
- c = cmd_find_client(cmdq, NULL, 1);
-
/* Destroy the old pipe. */
old_fd = wp->pipe_fd;
if (wp->pipe_fd != -1) {
diff --cc cmd-queue.c
index d842f00,61b1414..65f1146
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@@ -20,8 -20,8 +20,9 @@@
#include <ctype.h>
#include <stdlib.h>
+ #include <string.h>
#include <time.h>
+#include <string.h>
#include "tmux.h"
@@@ -152,65 -143,9 +150,65 @@@ cmdq_run(struct cmd_q *cmdq, struct cmd
}
}
+/*
+ * Run hooks based on the hooks prefix (before/after). Returns 1 if hooks are
+ * running.
+ */
+int
+cmdq_hooks_run(struct hooks *hooks, const char *prefix, const char *cmd_name,
+ struct cmd_q *cmdq)
+{
+ struct hook *hook;
+ struct cmd_q *hooks_cmdq;
+ char *s;
+
+ if (prefix != NULL && cmd_name != NULL)
+ xasprintf(&s, "%s-%s", prefix, cmd_name);
+ else
+ xasprintf(&s, "%s", cmd_name);
+ hook = hooks_find(hooks, s);
+
+ if (hook == NULL) {
+ free(s);
+ return (0);
+ }
+
+ hooks_cmdq = cmdq_new(cmdq != NULL ? cmdq->client : NULL);
+ hooks_cmdq->flags |= CMD_Q_NOHOOKS;
+
+ hooks_cmdq->emptyfn = cmdq_hooks_emptyfn;
+ hooks_cmdq->data = cmdq;
+
+ log_debug("entering hooks cmdq %p for %s", hooks_cmdq, s);
+ free(s);
+
+ if (cmdq != NULL)
+ cmdq->references++;
- cmdq_run(hooks_cmdq, hook->cmdlist);
++ cmdq_run(hooks_cmdq, hook->cmdlist, NULL);
+
+ return (1);
+}
+
+/* Callback when hooks cmdq is empty. */
+void
+cmdq_hooks_emptyfn(struct cmd_q *hooks_cmdq)
+{
+ struct cmd_q *cmdq = hooks_cmdq->data;
+
+ log_debug("exiting hooks cmdq %p", hooks_cmdq);
+
+ if (cmdq != NULL && hooks_cmdq->client_exit >= 0)
+ cmdq->client_exit = hooks_cmdq->client_exit;
+
+ if (cmdq != NULL && !cmdq_free(cmdq))
+ cmdq_continue(cmdq);
+
+ cmdq_free(hooks_cmdq);
+}
+
/* Add command list to queue. */
void
- cmdq_append(struct cmd_q *cmdq, struct cmd_list *cmdlist)
+ cmdq_append(struct cmd_q *cmdq, struct cmd_list *cmdlist, struct mouse_event
*m)
{
struct cmd_q_item *item;
@@@ -218,90 -153,25 +216,96 @@@
item->cmdlist = cmdlist;
TAILQ_INSERT_TAIL(&cmdq->queue, item, qentry);
cmdlist->references++;
+
+ if (m != NULL)
+ memcpy(&item->mouse, m, sizeof item->mouse);
+ else
+ item->mouse.valid = 0;
}
+/* Process one command. */
+enum cmd_retval
+cmdq_continue_one(struct cmd_q *cmdq)
+{
+ struct cmd *cmd = cmdq->cmd;
+ struct session *s;
+ struct hooks *hooks;
+ enum cmd_retval retval;
+ char tmp[1024];
+ int flags = !!(cmd->flags & CMD_CONTROL);
+
+ cmd_print(cmd, tmp, sizeof tmp);
+ log_debug("cmdq %p: %s", cmdq, tmp);
+
+ cmdq->time = time(NULL);
+ cmdq->number++;
+
+ if (~cmdq->flags & CMD_Q_REENTRY)
+ cmdq_guard(cmdq, "begin", flags);
+
+ if (~cmdq->flags & CMD_Q_NOHOOKS) {
+ if (cmd_prepare_state(cmd, cmdq) != 0)
+ goto error;
+
+ s = NULL;
+ if (cmdq->state.tflag.s != NULL)
+ s = cmdq->state.tflag.s;
+ else if (cmdq->state.sflag.s != NULL)
+ s = cmdq->state.sflag.s;
+ else if (cmdq->state.c != NULL)
+ s = cmdq->state.c->session;
+ if (s != NULL)
+ hooks = &s->hooks;
+ else
+ hooks = &global_hooks;
+
+ if (~cmdq->flags & CMD_Q_REENTRY) {
+ cmdq->flags |= CMD_Q_REENTRY;
+ if (cmdq_hooks_run(hooks, "before",
+ cmd->entry->name,cmdq)) {
+ return (CMD_RETURN_WAIT);
+ }
+ }
+ } else
+ hooks = NULL;
+ cmdq->flags &= ~CMD_Q_REENTRY;
+
+ if (cmd_prepare_state(cmd, cmdq) != 0)
+ goto error;
+ retval = cmd->entry->exec(cmd, cmdq);
+ if (retval == CMD_RETURN_ERROR)
+ goto error;
+
+ if (hooks != NULL && cmdq_hooks_run(hooks, "after",
+ cmd->entry->name, cmdq)) {
+ retval = CMD_RETURN_WAIT;
+ }
+ cmdq_guard(cmdq, "end", flags);
+
+ return (retval);
+
+error:
+ cmdq_guard(cmdq, "error", flags);
+
+ cmdq->flags &= ~CMD_Q_REENTRY;
+ return (CMD_RETURN_ERROR);
+}
+
/* Continue processing command queue. Returns 1 if finishes empty. */
int
cmdq_continue(struct cmd_q *cmdq)
{
+ struct client *c = cmdq->client;
struct cmd_q_item *next;
enum cmd_retval retval;
- int empty, flags;
- char s[1024];
+ int empty;
+ cmdq->references++;
notify_disable();
+ log_debug("continuing cmdq %p: flags=%#x, client=%d", cmdq, cmdq->flags,
+ c != NULL ? c->ibuf.fd : -1);
+
empty = TAILQ_EMPTY(&cmdq->queue);
if (empty)
goto empty;
diff --cc cmd-resize-pane.c
index 30f4d71,b342307..4904ee7
--- a/cmd-resize-pane.c
+++ b/cmd-resize-pane.c
@@@ -28,11 -28,14 +28,13 @@@
enum cmd_retval cmd_resize_pane_exec(struct cmd *, struct cmd_q *);
+ void cmd_resize_pane_mouse_update(struct client *, struct mouse_event *);
+
const struct cmd_entry cmd_resize_pane_entry = {
"resize-pane", "resizep",
- "DLRt:Ux:y:Z", 0, 1,
- "[-DLRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE "
[adjustment]",
+ "DLMRt:Ux:y:Z", 0, 1,
- "[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE
- " [adjustment]",
- 0,
++ "[-DLMRUZ] [-x width] [-y height] " CMD_TARGET_PANE_USAGE "
[adjustment]",
+ CMD_PREP_PANE_T,
cmd_resize_pane_exec
};
@@@ -40,14 -43,30 +42,27 @@@ enum cmd_retva
cmd_resize_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
+ struct window_pane *wp = cmdq->state.tflag.wp;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window *w = wl->window;
+ struct client *c = cmdq->client;
- struct session *s;
- struct winlink *wl;
- struct window *w;
++ struct session *s = cmdq->state.tflag.s;
const char *errstr;
char *cause;
u_int adjust;
int x, y;
+ if (args_has(args, 'M')) {
+ if (cmd_mouse_window(&cmdq->item->mouse, &s) == NULL)
+ return (CMD_RETURN_NORMAL);
+ if (c == NULL || c->session != s)
+ return (CMD_RETURN_NORMAL);
+ c->tty.mouse_drag_update = cmd_resize_pane_mouse_update;
+ cmd_resize_pane_mouse_update(c, &cmdq->item->mouse);
+ return (CMD_RETURN_NORMAL);
+ }
+
- if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp)) == NULL)
- return (CMD_RETURN_ERROR);
+ w = wl->window;
-
if (args_has(args, 'Z')) {
if (w->flags & WINDOW_ZOOMED)
window_unzoom(w);
diff --cc cmd-run-shell.c
index 3b5348f,134cbeb..a66333d
--- a/cmd-run-shell.c
+++ b/cmd-run-shell.c
@@@ -75,18 -75,33 +75,20 @@@ cmd_run_shell_exec(struct cmd *self, st
struct args *args = self->args;
struct cmd_run_shell_data *cdata;
char *shellcmd;
- struct client *c;
- struct session *s = NULL;
- struct winlink *wl = NULL;
- struct window_pane *wp = NULL;
+ struct session *s = cmdq->state.tflag.s;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window_pane *wp = cmdq->state.tflag.wp;
struct format_tree *ft;
-
+ int cwd;
+
- if (args_has(args, 't')) {
- wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
- cwd = wp->cwd;
- } else {
- c = cmd_find_client(cmdq, NULL, 1);
- if (c != NULL && c->session != NULL) {
- s = c->session;
- wl = s->curw;
- wp = wl->window->active;
- }
- if (cmdq->client != NULL && cmdq->client->session == NULL)
- cwd = cmdq->client->cwd;
- else if (s != NULL)
- cwd = s->cwd;
- else
- cwd = -1;
- }
-
++ if (cmdq->client != NULL && cmdq->client->session == NULL)
++ cwd = cmdq->client->cwd;
++ else if (s != NULL)
++ cwd = s->cwd;
++ else
++ cwd = -1;
ft = format_create();
- if (s != NULL)
- format_session(ft, s);
- if (s != NULL && wl != NULL)
- format_winlink(ft, s, wl);
- if (wp != NULL)
- format_window_pane(ft, wp);
+ format_defaults(ft, NULL, s, wl, wp);
shellcmd = format_expand(ft, args->argv[0]);
format_free(ft);
diff --cc cmd-select-layout.c
index 9ba6de3,14737dc..26227c5
--- a/cmd-select-layout.c
+++ b/cmd-select-layout.c
@@@ -28,9 -30,9 +30,9 @@@ enum cmd_retval cmd_select_layout_exec
const struct cmd_entry cmd_select_layout_entry = {
"select-layout", "selectl",
- "npt:", 0, 1,
- "[-np] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
+ "nopt:", 0, 1,
+ "[-nop] " CMD_TARGET_WINDOW_USAGE " [layout-name]",
- 0,
+ CMD_PREP_WINDOW_T,
cmd_select_layout_exec
};
@@@ -54,45 -56,72 +56,69 @@@ enum cmd_retva
cmd_select_layout_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct winlink *wl;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window *w;
const char *layoutname;
+ char *oldlayout;
int next, previous, layout;
- server_unzoom_window(wl->window);
- if ((wl = cmd_find_window(cmdq, args_get(args, 't'), NULL)) == NULL)
- return (CMD_RETURN_ERROR);
+ w = wl->window;
-
+ server_unzoom_window(w);
next = self->entry == &cmd_next_layout_entry;
- if (args_has(self->args, 'n'))
+ if (args_has(args, 'n'))
next = 1;
previous = self->entry == &cmd_previous_layout_entry;
- if (args_has(self->args, 'p'))
+ if (args_has(args, 'p'))
previous = 1;
+ oldlayout = w->old_layout;
+ w->old_layout = layout_dump(w->layout_root);
+
if (next || previous) {
if (next)
- layout = layout_set_next(wl->window);
+ layout_set_next(w);
else
- layout = layout_set_previous(wl->window);
- server_redraw_window(wl->window);
- return (CMD_RETURN_NORMAL);
+ layout_set_previous(w);
+ goto changed;
}
- if (args->argc == 0)
- layout = wl->window->lastlayout;
- else
- layout = layout_set_lookup(args->argv[0]);
- if (layout != -1) {
- layout = layout_set_select(wl->window, layout);
- server_redraw_window(wl->window);
- return (CMD_RETURN_NORMAL);
+ if (!args_has(args, 'o')) {
+ if (args->argc == 0)
+ layout = w->lastlayout;
+ else
+ layout = layout_set_lookup(args->argv[0]);
+ if (layout != -1) {
+ layout_set_select(w, layout);
+ goto changed;
+ }
}
- if (args->argc != 0) {
+ if (args->argc != 0)
layoutname = args->argv[0];
- if (layout_parse(wl->window, layoutname) == -1) {
+ else if (args_has(args, 'o'))
+ layoutname = oldlayout;
+ else
+ layoutname = NULL;
+
+ if (layoutname != NULL) {
+ if (layout_parse(w, layoutname) == -1) {
cmdq_error(cmdq, "can't set layout: %s", layoutname);
- return (CMD_RETURN_ERROR);
+ goto error;
}
- server_redraw_window(wl->window);
+ goto changed;
}
+
+ free(oldlayout);
return (CMD_RETURN_NORMAL);
+
+ changed:
+ free(oldlayout);
+ server_redraw_window(w);
+ return (CMD_RETURN_NORMAL);
+
+ error:
+ free(w->old_layout);
+ w->old_layout = oldlayout;
+ return (CMD_RETURN_ERROR);
}
diff --cc cmd-select-pane.c
index 90850f6,e7f2249..efa03c8
--- a/cmd-select-pane.c
+++ b/cmd-select-pane.c
@@@ -28,9 -28,9 +28,9 @@@ enum cmd_retval cmd_select_pane_exec(s
const struct cmd_entry cmd_select_pane_entry = {
"select-pane", "selectp",
- "DdeLlRt:U", 0, 0,
- "[-DdeLlRU] " CMD_TARGET_PANE_USAGE,
- "DdegLlP:Rt:U", 0, 0,
- "[-DdegLlRU] [-P style] " CMD_TARGET_PANE_USAGE,
- 0,
++ "DdeLlP:Rt:U", 0, 0,
++ "[-DdeLlRU] [-P style] " CMD_TARGET_PANE_USAGE,
+ CMD_PREP_PANE_T,
cmd_select_pane_exec
};
@@@ -46,10 -46,15 +46,11 @@@ enum cmd_retva
cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct winlink *wl;
- struct window_pane *wp;
+ struct winlink *wl = cmdq->state.tflag.wl;
+ struct window_pane *wp = cmdq->state.tflag.wp;
+ const char *style;
if (self->entry == &cmd_last_pane_entry || args_has(args, 'l')) {
- wl = cmd_find_window(cmdq, args_get(args, 't'), NULL);
- if (wl == NULL)
- return (CMD_RETURN_ERROR);
-
if (wl->window->last == NULL) {
cmdq_error(cmdq, "no last pane");
return (CMD_RETURN_ERROR);
@@@ -69,12 -74,24 +70,27 @@@
return (CMD_RETURN_NORMAL);
}
- if ((wl = cmd_find_pane(cmdq, args_get(args, 't'), NULL, &wp)) == NULL)
+ server_unzoom_window(wp->window);
+ if (!window_pane_visible(wp)) {
+ cmdq_error(cmdq, "pane not visible");
return (CMD_RETURN_ERROR);
+ }
+ if (args_has(self->args, 'P') || args_has(self->args, 'g')) {
+ if (args_has(args, 'P')) {
+ style = args_get(args, 'P');
+ if (style_parse(&grid_default_cell, &wp->colgc,
+ style) == -1) {
+ cmdq_error(cmdq, "bad style: %s", style);
+ return (CMD_RETURN_ERROR);
+ }
+ wp->flags |= PANE_REDRAW;
+ }
+ if (args_has(self->args, 'g'))
+ cmdq_print(cmdq, "%s", style_tostring(&wp->colgc));
+ return (CMD_RETURN_NORMAL);
+ }
+
if (args_has(self->args, 'L'))
wp = window_pane_find_left(wp);
else if (args_has(self->args, 'R'))
diff --cc cmd-send-keys.c
index b5f3293,27da410..224cd56
--- a/cmd-send-keys.c
+++ b/cmd-send-keys.c
@@@ -31,9 -31,9 +31,9 @@@ enum cmd_retval cmd_send_keys_exec(str
const struct cmd_entry cmd_send_keys_entry = {
"send-keys", "send",
- "lRt:", 0, -1,
- "[-lR] " CMD_TARGET_PANE_USAGE " key ...",
+ "lRMt:", 0, -1,
+ "[-lRM] " CMD_TARGET_PANE_USAGE " key ...",
- 0,
+ CMD_PREP_PANE_T,
cmd_send_keys_exec
};
@@@ -49,12 -49,26 +49,23 @@@ enum cmd_retva
cmd_send_keys_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
+ struct window_pane *wp = cmdq->state.tflag.wp;
+ struct session *s = cmdq->state.tflag.s;
+ struct mouse_event *m = &cmdq->item->mouse;
- struct window_pane *wp;
- struct session *s;
struct input_ctx *ictx;
const u_char *str;
int i, key;
+ if (args_has(args, 'M')) {
+ wp = cmd_mouse_pane(m, &s, NULL);
+ if (wp == NULL) {
+ cmdq_error(cmdq, "no mouse target");
+ return (CMD_RETURN_ERROR);
+ }
+ window_pane_key(wp, NULL, s, m->key, m);
+ return (CMD_RETURN_NORMAL);
+ }
+
- if (cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp) == NULL)
- return (CMD_RETURN_ERROR);
-
if (self->entry == &cmd_send_prefix_entry) {
if (args_has(args, '2'))
key = options_get_number(&s->options, "prefix2");
diff --cc cmd-set-option.c
index 5d03ae6,83d31b9..8699b18
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@@ -84,14 -84,13 +84,13 @@@ enum cmd_retva
cmd_set_option_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- const struct options_table_entry *table, *oe;
- struct session *s;
- struct winlink *wl;
+ struct session *s = cmdq->state.tflag.s;
+ struct winlink *wl = cmdq->state.tflag.wl;
struct client *c;
- struct options *oo;
struct window *w;
+ const struct options_table_entry *table, *oe;
+ struct options *oo;
const char *optstr, *valstr;
- u_int i;
/* Get the option name and value. */
optstr = args->argv[0];
diff --cc cmd-show-messages.c
index eebafe1,ccc11c9..5dcd638
--- a/cmd-show-messages.c
+++ b/cmd-show-messages.c
@@@ -126,10 -126,9 +126,9 @@@ enum cmd_retva
cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct client *c;
+ struct client *c = cmdq->state.c;
struct message_entry *msg;
char *tim;
- u_int i;
int done;
done = 0;
@@@ -152,9 -151,10 +151,7 @@@
if (done)
return (CMD_RETURN_NORMAL);
- for (i = 0; i < ARRAY_LENGTH(&c->message_log); i++) {
- msg = &ARRAY_ITEM(&c->message_log, i);
-
- if ((c = cmd_find_client(cmdq, args_get(args, 't'), 0)) == NULL)
- return (CMD_RETURN_ERROR);
-
+ TAILQ_FOREACH(msg, &c->message_log, entry) {
tim = ctime(&msg->msg_time);
*strchr(tim, '\n') = '\0';
diff --cc cmd-split-window.c
index 19b8171,50799cf..8d8fa08
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@@ -84,11 -87,8 +84,7 @@@ cmd_split_window_exec(struct cmd *self
if (args_has(args, 'c')) {
ft = format_create();
- if (cmdq->state.c != NULL)
- format_client(ft, cmdq->state.c);
- format_session(ft, s);
- format_winlink(ft, s, s->curw);
- format_window_pane(ft, s->curw->window->active);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
- NULL);
++ format_defaults(ft, cmdq->state.c, s, NULL, NULL);
cp = format_expand(ft, args_get(args, 'c'));
format_free(ft);
@@@ -176,11 -176,8 +172,7 @@@
template = SPLIT_WINDOW_TEMPLATE;
ft = format_create();
- if (cmdq->state.c != NULL)
- format_client(ft, cmdq->state.c);
- format_session(ft, s);
- format_winlink(ft, s, wl);
- format_window_pane(ft, new_wp);
- format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl,
- new_wp);
++ format_defaults(ft, cmdq->state.c, s, wl, new_wp);
cp = format_expand(ft, template);
cmdq_print(cmdq, "%s", cp);
diff --cc cmd-switch-client.c
index d05f463,18de0eb..d837610
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@@ -31,10 -31,9 +31,10 @@@ enum cmd_retval cmd_switch_client_exec
const struct cmd_entry cmd_switch_client_entry = {
"switch-client", "switchc",
- "lc:npt:r", 0, 0,
- "[-lnpr] [-c target-client] " CMD_TARGET_SESSION_USAGE,
+ "lc:npt:rT:", 0, 0,
- "[-lnpr] [-c target-client] [-t target-session] [-T key-table]",
- CMD_READONLY,
++ "[-lnpr] [-c target-client] [-T key-table] " CMD_TARGET_SESSION_USAGE,
+ CMD_READONLY|CMD_PREP_CLIENT_C|CMD_PREP_PANE_T|CMD_PREP_SESSION_T|
+ CMD_PREP_PREFERUNATTACHED,
cmd_switch_client_exec
};
@@@ -42,10 -41,16 +42,13 @@@ enum cmd_retva
cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
{
struct args *args = self->args;
- struct client *c;
- struct session *s = NULL;
- struct winlink *wl = NULL;
- struct window *w = NULL;
- struct window_pane *wp = NULL;
- const char *tflag, *tablename;
+ struct cmd_state *state = &cmdq->state;
+ struct client *c = state->c;
- struct session *s;
++ struct session *s = cmdq->state.tflag.s;
+ struct window_pane *wp;
++ const char *tablename;
+ struct key_table *table;
+
- if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL)
- return (CMD_RETURN_ERROR);
if (args_has(args, 'r')) {
if (c->flags & CLIENT_READONLY)
@@@ -54,6 -59,19 +57,18 @@@
c->flags |= CLIENT_READONLY;
}
+ tablename = args_get(args, 'T');
+ if (tablename != NULL) {
+ table = key_bindings_get_table(tablename, 0);
+ if (table == NULL) {
+ cmdq_error(cmdq, "table %s doesn't exist", tablename);
+ return (CMD_RETURN_ERROR);
+ }
+ table->references++;
+ key_bindings_unref_table(c->keytable);
+ c->keytable = table;
+ }
+
- tflag = args_get(args, 't');
if (args_has(args, 'n')) {
if ((s = session_next_session(c->session)) == NULL) {
cmdq_error(cmdq, "can't find next session");
@@@ -73,7 -89,26 +88,6 @@@
cmdq_error(cmdq, "can't find last session");
return (CMD_RETURN_ERROR);
}
-- } else {
- if (tflag == NULL) {
- if ((s = cmd_find_session(cmdq, tflag, 1)) == NULL)
- return (CMD_RETURN_ERROR);
- } else if (tflag[strcspn(tflag, ":.")] != '\0') {
- if ((wl = cmd_find_pane(cmdq, tflag, &s, &wp)) == NULL)
- return (CMD_RETURN_ERROR);
- } else {
- if ((s = cmd_find_session(cmdq, tflag, 1)) == NULL)
- return (CMD_RETURN_ERROR);
- w = window_find_by_id_str(tflag);
- if (w == NULL) {
- wp = window_pane_find_by_id_str(tflag);
- if (wp != NULL)
- w = wp->window;
- }
- if (w != NULL)
- wl = winlink_find_by_window(&s->windows, w);
- }
-
if (cmdq->client == NULL)
return (CMD_RETURN_NORMAL);
diff --cc cmd.c
index 3feeb47,14d69a7..130d90c
--- a/cmd.c
+++ b/cmd.c
@@@ -127,26 -115,6 +127,10 @@@ const struct cmd_entry *cmd_table[] =
NULL
};
+void cmd_clear_state(struct cmd_state *);
+struct client *cmd_get_state_client(struct cmd_q *, int);
+int cmd_set_state_tflag(struct cmd *, struct cmd_q *);
+int cmd_set_state_sflag(struct cmd *, struct cmd_q *);
- int cmd_session_better(struct session *, struct session *, int);
- struct session *cmd_choose_session_list(struct sessionslist *);
- struct session *cmd_choose_session(int);
- struct client *cmd_choose_client(struct clients *);
- struct client *cmd_lookup_client(const char *);
- struct session *cmd_lookup_session(struct cmd_q *, const char *, int
*);
- struct session *cmd_lookup_session_id(const char *);
- struct winlink *cmd_lookup_window(struct session *, const char *, int
*);
- int cmd_lookup_index(struct session *, const char *, int *);
- struct winlink *cmd_lookup_winlink_windowid(struct session *, const
char *);
- struct session *cmd_window_session(struct cmd_q *, struct window *,
- struct winlink **);
- struct winlink *cmd_find_window_offset(const char *, struct session *,
int *);
- int cmd_find_index_offset(const char *, struct session *, int *);
- struct window_pane *cmd_find_pane_offset(const char *, struct winlink *);
-
int
cmd_pack_argv(int argc, char **argv, char *buf, size_t len)
{
@@@ -690,984 -343,42 +674,24 @@@ cmd_has_session_alert(struct session *s
return (0);
}
- /*
- * Figure out the current session. Use: 1) the current session, if the command
- * context has one; 2) the most recently used session containing the pty of
the
- * calling client, if any; 3) the session specified in the TMUX variable from
- * the environment (as passed from the client); 4) the most recently used
- * session from all sessions.
- */
- struct session *
- cmd_current_session(struct cmd_q *cmdq, int prefer_unattached)
- {
- struct client *c = cmdq->client;
- struct session *s;
- struct sessionslist ss;
- struct winlink *wl;
- struct window_pane *wp;
- const char *path;
- int found;
-
- /* If there's no alerts present, and there's a current session, return
- * that.
- */
- if (RB_EMPTY(&alerts) && c != NULL && c->session != NULL)
- return (c->session);
-
- /* Check all sessions for alerts, and for any one found, use that. */
- RB_FOREACH(s, sessions, &sessions) {
- if (cmd_has_session_alert(s, NULL)) {
- return (s);
- }
- }
-
- /*
- * If the name of the calling client's pty is known, build a list of
- * the sessions that contain it and if any choose either the first or
- * the newest.
- */
- path = c == NULL ? NULL : c->tty.path;
- if (path != NULL) {
- ARRAY_INIT(&ss);
- RB_FOREACH(s, sessions, &sessions) {
- found = 0;
- RB_FOREACH(wl, winlinks, &s->windows) {
- TAILQ_FOREACH(wp, &wl->window->panes, entry) {
- if (strcmp(wp->tty, path) == 0) {
- found = 1;
- break;
- }
- }
- if (found)
- break;
- }
- if (found)
- ARRAY_ADD(&ss, s);
- }
-
- s = cmd_choose_session_list(&ss);
- ARRAY_FREE(&ss);
- if (s != NULL)
- return (s);
- }
-
- return (cmd_choose_session(prefer_unattached));
- }
-
- /* Is this session better? */
- int
- cmd_session_better(struct session *s, struct session *best,
- int prefer_unattached)
- {
- if (best == NULL)
- return (1);
- if (prefer_unattached) {
- if (!(best->flags & SESSION_UNATTACHED) &&
- (s->flags & SESSION_UNATTACHED))
- return (1);
- else if ((best->flags & SESSION_UNATTACHED) &&
- !(s->flags & SESSION_UNATTACHED))
- return (0);
- }
- return (timercmp(&s->activity_time, &best->activity_time, >));
- }
-
- /*
- * Find the most recently used session, preferring unattached if the flag is
- * set.
- */
- struct session *
- cmd_choose_session(int prefer_unattached)
- {
- struct session *s, *best;
-
- best = NULL;
- RB_FOREACH(s, sessions, &sessions) {
- if (cmd_session_better(s, best, prefer_unattached))
- best = s;
- }
- return (best);
- }
-
- /* Find the most recently used session from a list. */
- struct session *
- cmd_choose_session_list(struct sessionslist *ss)
- {
- struct session *s, *sbest;
- struct timeval *tv = NULL;
- u_int i;
-
- sbest = NULL;
- for (i = 0; i < ARRAY_LENGTH(ss); i++) {
- if ((s = ARRAY_ITEM(ss, i)) == NULL)
- continue;
-
- if (tv == NULL || timercmp(&s->activity_time, tv, >)) {
- sbest = s;
- tv = &s->activity_time;
- }
- }
-
- return (sbest);
- }
-
- /*
- * Find the current client. First try the current client if set, then pick the
- * most recently used of the clients attached to the current session if any,
- * then of all clients.
- */
- struct client *
- cmd_current_client(struct cmd_q *cmdq)
- {
- struct session *s;
- struct client *c;
- struct clients cc;
- u_int i;
-
- if (cmdq->client != NULL && cmdq->client->session != NULL)
- return (cmdq->client);
-
- /*
- * No current client set. Find the current session and return the
- * newest of its clients.
- */
- s = cmd_current_session(cmdq, 0);
- if (s != NULL && !(s->flags & SESSION_UNATTACHED)) {
- ARRAY_INIT(&cc);
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- if ((c = ARRAY_ITEM(&clients, i)) == NULL)
- continue;
- if (s == c->session)
- ARRAY_ADD(&cc, c);
- }
-
- c = cmd_choose_client(&cc);
- ARRAY_FREE(&cc);
- if (c != NULL)
- return (c);
- }
-
- return (cmd_choose_client(&clients));
- }
-
- /* Choose the most recently used client from a list. */
- struct client *
- cmd_choose_client(struct clients *cc)
- {
- struct client *c, *cbest;
- struct timeval *tv = NULL;
- u_int i;
-
- cbest = NULL;
- for (i = 0; i < ARRAY_LENGTH(cc); i++) {
- if ((c = ARRAY_ITEM(cc, i)) == NULL)
- continue;
- if (c->session == NULL)
- continue;
-
- if (tv == NULL || timercmp(&c->activity_time, tv, >)) {
- cbest = c;
- tv = &c->activity_time;
- }
- }
-
- return (cbest);
- }
-
- /* Find the target client or report an error and return NULL. */
- struct client *
- cmd_find_client(struct cmd_q *cmdq, const char *arg, int quiet)
- {
- struct client *c;
- char *tmparg;
- size_t arglen;
-
- /* A NULL argument means the current client. */
- if (arg == NULL) {
- c = cmd_current_client(cmdq);
- if (c == NULL && !quiet)
- cmdq_error(cmdq, "no clients");
- return (c);
- }
- tmparg = xstrdup(arg);
-
- /* Trim a single trailing colon if any. */
- arglen = strlen(tmparg);
- if (arglen != 0 && tmparg[arglen - 1] == ':')
- tmparg[arglen - 1] = '\0';
-
- /* Find the client, if any. */
- c = cmd_lookup_client(tmparg);
-
- /* If no client found, report an error. */
- if (c == NULL && !quiet)
- cmdq_error(cmdq, "client not found: %s", tmparg);
-
- free(tmparg);
- return (c);
- }
-
- /*
- * Lookup a client by device path. Either of a full match and a match without
a
- * leading _PATH_DEV ("/dev/") is accepted.
- */
- struct client *
- cmd_lookup_client(const char *name)
- {
- struct client *c;
- const char *path;
- u_int i;
-
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session == NULL || c->tty.path == NULL)
- continue;
- path = c->tty.path;
-
- /* Check for exact matches. */
- if (strcmp(name, path) == 0)
- return (c);
-
- /* Check without leading /dev if present. */
- if (strncmp(path, _PATH_DEV, (sizeof _PATH_DEV) - 1) != 0)
- continue;
- if (strcmp(name, path + (sizeof _PATH_DEV) - 1) == 0)
- return (c);
- }
-
- return (NULL);
- }
-
- /* Find the target session or report an error and return NULL. */
- struct session *
- cmd_lookup_session_id(const char *arg)
- {
- char *endptr;
- long id;
-
- if (arg[0] != '$')
- return (NULL);
- id = strtol(arg + 1, &endptr, 10);
- if (arg[1] != '\0' && *endptr == '\0')
- return (session_find_by_id(id));
- return (NULL);
- }
-
- /* Lookup a session by name. If no session is found, NULL is returned. */
- struct session *
- cmd_lookup_session(struct cmd_q *cmdq, const char *name, int *ambiguous)
- {
- struct session *s, *sfound;
- struct window *w;
- struct window_pane *wp;
-
- *ambiguous = 0;
-
- /* Look for $id first. */
- if ((s = cmd_lookup_session_id(name)) != NULL)
- return (s);
-
- /* Try as pane or window id. */
- if ((wp = cmd_lookup_paneid(name)) != NULL)
- return (cmd_window_session(cmdq, wp->window, NULL));
- if ((w = cmd_lookup_windowid(name)) != NULL)
- return (cmd_window_session(cmdq, w, NULL));
-
- /*
- * Look for matches. First look for exact matches - session names must
- * be unique so an exact match can't be ambigious and can just be
- * returned.
- */
- if ((s = session_find(name)) != NULL)
- return (s);
-
- /*
- * Otherwise look for partial matches, returning early if it is found to
- * be ambiguous.
- */
- sfound = NULL;
- RB_FOREACH(s, sessions, &sessions) {
- if (strncmp(name, s->name, strlen(name)) == 0 ||
- fnmatch(name, s->name, 0) == 0) {
- if (sfound != NULL) {
- *ambiguous = 1;
- return (NULL);
- }
- sfound = s;
- }
- }
- return (sfound);
- }
-
- /*
- * Lookup a window or return -1 if not found or ambigious. First try as an
- * index and if invalid, use fnmatch or leading prefix. Return NULL but fill
in
- * idx if the window index is a valid number but there is no window with that
- * index.
- */
- struct winlink *
- cmd_lookup_window(struct session *s, const char *name, int *ambiguous)
- {
- struct winlink *wl, *wlfound;
- struct window *w;
- struct window_pane *wp;
- const char *errstr;
- u_int idx;
-
- *ambiguous = 0;
-
- /* Try as pane or window id. */
- if ((wl = cmd_lookup_winlink_windowid(s, name)) != NULL)
- return (wl);
-
- /* Lookup as pane or window id. */
- if ((wp = cmd_lookup_paneid(name)) != NULL) {
- wl = winlink_find_by_window(&s->windows, wp->window);
- if (wl != NULL)
- return (wl);
- }
- if ((w = cmd_lookup_windowid(name)) != NULL) {
- wl = winlink_find_by_window(&s->windows, w);
- if (wl != NULL)
- return (wl);
- }
-
- /* First see if this is a valid window index in this session. */
- idx = strtonum(name, 0, INT_MAX, &errstr);
- if (errstr == NULL) {
- if ((wl = winlink_find_by_index(&s->windows, idx)) != NULL)
- return (wl);
- }
-
- /* Look for exact matches, error if more than one. */
- wlfound = NULL;
- RB_FOREACH(wl, winlinks, &s->windows) {
- if (strcmp(name, wl->window->name) == 0) {
- if (wlfound != NULL) {
- *ambiguous = 1;
- return (NULL);
- }
- wlfound = wl;
- }
- }
- if (wlfound != NULL)
- return (wlfound);
-
- /* Now look for pattern matches, again error if multiple. */
- wlfound = NULL;
- RB_FOREACH(wl, winlinks, &s->windows) {
- if (strncmp(name, wl->window->name, strlen(name)) == 0 ||
- fnmatch(name, wl->window->name, 0) == 0) {
- if (wlfound != NULL) {
- *ambiguous = 1;
- return (NULL);
- }
- wlfound = wl;
- }
- }
- if (wlfound != NULL)
- return (wlfound);
-
- return (NULL);
- }
-
- /*
- * Find a window index - if the window doesn't exist, check if it is a
- * potential index and return it anyway.
- */
- int
- cmd_lookup_index(struct session *s, const char *name, int *ambiguous)
- {
- struct winlink *wl;
- const char *errstr;
- u_int idx;
-
- if ((wl = cmd_lookup_window(s, name, ambiguous)) != NULL)
- return (wl->idx);
- if (*ambiguous)
- return (-1);
-
- idx = strtonum(name, 0, INT_MAX, &errstr);
- if (errstr == NULL)
- return (idx);
-
- return (-1);
- }
-/* Get current mouse window if any. */
-struct winlink *
-cmd_mouse_window(struct mouse_event *m, struct session **sp)
-{
- struct session *s;
- struct window *w;
-
- if (!m->valid || m->s == -1 || m->w == -1)
- return (NULL);
- if ((s = session_find_by_id(m->s)) == NULL)
- return (NULL);
- if ((w = window_find_by_id(m->w)) == NULL)
- return (NULL);
-
- if (sp != NULL)
- *sp = s;
- return (winlink_find_by_window(&s->windows, w));
-}
- /* Lookup pane id. An initial % means a pane id. */
+ /* Get current mouse pane if any. */
struct window_pane *
- cmd_lookup_paneid(const char *arg)
- {
- const char *errstr;
- u_int paneid;
-
- if (arg == NULL || *arg != '%')
- return (NULL);
-
- paneid = strtonum(arg + 1, 0, UINT_MAX, &errstr);
- if (errstr != NULL)
- return (NULL);
- return (window_pane_find_by_id(paneid));
- }
-
- /* Lookup window id in a session. An initial @ means a window id. */
- struct winlink *
- cmd_lookup_winlink_windowid(struct session *s, const char *arg)
+ cmd_mouse_pane(struct mouse_event *m, struct session **sp,
+ struct winlink **wlp)
{
- const char *errstr;
- u_int windowid;
-
- if (arg == NULL || *arg != '@')
- return (NULL);
+ struct winlink *wl;
+ struct window_pane *wp;
- windowid = strtonum(arg + 1, 0, UINT_MAX, &errstr);
- if (errstr != NULL)
+ if ((wl = cmd_mouse_window(m, sp)) == NULL)
return (NULL);
- return (winlink_find_by_window_id(&s->windows, windowid));
- }
-
- /* Lookup window id. An initial @ means a window id. */
- struct window *
- cmd_lookup_windowid(const char *arg)
- {
- const char *errstr;
- u_int windowid;
-
- if (arg == NULL || *arg != '@')
+ if ((wp = window_pane_find_by_id(m->wp)) == NULL)
return (NULL);
-
- windowid = strtonum(arg + 1, 0, UINT_MAX, &errstr);
- if (errstr != NULL)
+ if (!window_has_pane(wl->window, wp))
return (NULL);
- return (window_find_by_id(windowid));
- }
- /* Find session and winlink for window. */
- struct session *
- cmd_window_session(struct cmd_q *cmdq, struct window *w, struct winlink **wlp)
- {
- struct session *s;
- struct sessionslist ss;
- struct winlink *wl;
-
- /* If this window is in the current session, return that winlink. */
- s = cmd_current_session(cmdq, 0);
- if (s != NULL) {
- wl = winlink_find_by_window(&s->windows, w);
- if (wl != NULL) {
- if (wlp != NULL)
- *wlp = wl;
- return (s);
- }
- }
-
- /* Otherwise choose from all sessions with this window. */
- ARRAY_INIT(&ss);
- RB_FOREACH(s, sessions, &sessions) {
- if (winlink_find_by_window(&s->windows, w) != NULL)
- ARRAY_ADD(&ss, s);
- }
- s = cmd_choose_session_list(&ss);
- ARRAY_FREE(&ss);
if (wlp != NULL)
- *wlp = winlink_find_by_window(&s->windows, w);
- return (s);
- }
-
- /* Find the target session or report an error and return NULL. */
- struct session *
- cmd_find_session(struct cmd_q *cmdq, const char *arg, int prefer_unattached)
- {
- struct session *s;
- struct client *c;
- char *tmparg;
- size_t arglen;
- int ambiguous;
-
- /* A NULL argument means the current session. */
- if (arg == NULL) {
- if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL)
- cmdq_error(cmdq, "can't establish current session");
- return (s);
- }
-
- /* Trim a single trailing colon if any. */
- tmparg = xstrdup(arg);
- arglen = strlen(tmparg);
- if (arglen != 0 && tmparg[arglen - 1] == ':')
- tmparg[arglen - 1] = '\0';
-
- /* An empty session name is the current session. */
- if (*tmparg == '\0') {
- free(tmparg);
- if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL)
- cmdq_error(cmdq, "can't establish current session");
- return (s);
- }
-
- /* Find the session, if any. */
- s = cmd_lookup_session(cmdq, tmparg, &ambiguous);
-
- /* If it doesn't, try to match it as a client. */
- if (s == NULL && (c = cmd_lookup_client(tmparg)) != NULL)
- s = c->session;
-
- /* If no session found, report an error. */
- if (s == NULL) {
- if (ambiguous)
- cmdq_error(cmdq, "more than one session: %s", tmparg);
- else
- cmdq_error(cmdq, "session not found: %s", tmparg);
- }
-
- free(tmparg);
- return (s);
- }
-
- /* Find the target session and window or report an error and return NULL. */
- struct winlink *
- cmd_find_window(struct cmd_q *cmdq, const char *arg, struct session **sp)
- {
- struct session *s;
- struct winlink *wl;
- struct alert *al;
- const char *winptr;
- char *sessptr = NULL;
- int ambiguous = 0;
-
- /*
- * Find the current session. There must always be a current session, if
- * it can't be found, report an error.
- */
- if ((s = cmd_current_session(cmdq, 0)) == NULL) {
- cmdq_error(cmdq, "can't establish current session");
- return (NULL);
- }
-
- /* A NULL argument means the current session and window. */
- if (arg == NULL) {
- if (sp != NULL)
- *sp = s;
- if (cmd_has_session_alert(s, &al)) {
- RB_FOREACH(wl, winlinks, &s->windows) {
- if (wl->flags & al->flag) {
- return (wl);
- }
- }
- }
- return (s->curw);
- }
-
- /* Time to look at the argument. If it is empty, that is an error. */
- if (*arg == '\0')
- goto not_found;
-
- /* Find the separating colon and split into window and session. */
- winptr = strchr(arg, ':');
- if (winptr == NULL)
- goto no_colon;
- winptr++; /* skip : */
- sessptr = xstrdup(arg);
- *strchr(sessptr, ':') = '\0';
-
- /* Try to lookup the session if present. */
- if (*sessptr != '\0') {
- if ((s = cmd_lookup_session(cmdq, sessptr, &ambiguous)) == NULL)
- goto no_session;
- }
- if (sp != NULL)
- *sp = s;
-
- /*
- * Then work out the window. An empty string is the current window,
- * otherwise try special cases then to look it up in the session.
- */
- if (*winptr == '\0')
- wl = s->curw;
- else if (winptr[0] == '!' && winptr[1] == '\0')
- wl = TAILQ_FIRST(&s->lastw);
- else if (winptr[0] == '^' && winptr[1] == '\0')
- wl = RB_MIN(winlinks, &s->windows);
- else if (winptr[0] == '$' && winptr[1] == '\0')
- wl = RB_MAX(winlinks, &s->windows);
- else if (winptr[0] == '+' || winptr[0] == '-')
- wl = cmd_find_window_offset(winptr, s, &ambiguous);
- else
- wl = cmd_lookup_window(s, winptr, &ambiguous);
- if (wl == NULL)
- goto not_found;
-
- if (sessptr != NULL)
- free(sessptr);
- return (wl);
-
- no_colon:
- /*
- * No colon in the string, first try special cases, then as a window
- * and lastly as a session.
- */
- if (arg[0] == '!' && arg[1] == '\0') {
- if ((wl = TAILQ_FIRST(&s->lastw)) == NULL)
- goto not_found;
- } else if (arg[0] == '+' || arg[0] == '-') {
- if ((wl = cmd_find_window_offset(arg, s, &ambiguous)) == NULL)
- goto lookup_session;
- } else if ((wl = cmd_lookup_window(s, arg, &ambiguous)) == NULL)
- goto lookup_session;
-
- if (sp != NULL)
- *sp = s;
-
- return (wl);
-
- lookup_session:
- if (ambiguous)
- goto not_found;
- if (*arg != '\0' &&
- (s = cmd_lookup_session(cmdq, arg, &ambiguous)) == NULL)
- goto no_session;
-
- if (sp != NULL)
- *sp = s;
-
- return (s->curw);
-
- no_session:
- if (ambiguous)
- cmdq_error(cmdq, "multiple sessions: %s", arg);
- else
- cmdq_error(cmdq, "session not found: %s", arg);
- free(sessptr);
- return (NULL);
-
- not_found:
- if (ambiguous)
- cmdq_error(cmdq, "multiple windows: %s", arg);
- else
- cmdq_error(cmdq, "window not found: %s", arg);
- free(sessptr);
- return (NULL);
- }
-
- struct winlink *
- cmd_find_window_offset(const char *winptr, struct session *s, int *ambiguous)
- {
- struct winlink *wl;
- int offset = 1;
-
- if (winptr[1] != '\0')
- offset = strtonum(winptr + 1, 1, INT_MAX, NULL);
- if (offset == 0)
- wl = cmd_lookup_window(s, winptr, ambiguous);
- else {
- if (winptr[0] == '+')
- wl = winlink_next_by_number(s->curw, s, offset);
- else
- wl = winlink_previous_by_number(s->curw, s, offset);
- }
-
- return (wl);
- }
-
- /*
- * Find the target session and window index, whether or not it exists in the
- * session. Return -2 on error or -1 if no window index is specified. This is
- * used when parsing an argument for a window target that may not exist (for
- * example if it is going to be created).
- */
- int
- cmd_find_index(struct cmd_q *cmdq, const char *arg, struct session **sp)
- {
- struct session *s;
- struct winlink *wl;
- const char *winptr;
- char *sessptr = NULL;
- int idx, ambiguous = 0;
-
- /*
- * Find the current session. There must always be a current session, if
- * it can't be found, report an error.
- */
- if ((s = cmd_current_session(cmdq, 0)) == NULL) {
- cmdq_error(cmdq, "can't establish current session");
- return (-2);
- }
-
- /* A NULL argument means the current session and "no window" (-1). */
- if (arg == NULL) {
- if (sp != NULL)
- *sp = s;
- return (-1);
- }
-
- /* Time to look at the argument. If it is empty, that is an error. */
- if (*arg == '\0')
- goto not_found;
-
- /* Find the separating colon. If none, assume the current session. */
- winptr = strchr(arg, ':');
- if (winptr == NULL)
- goto no_colon;
- winptr++; /* skip : */
- sessptr = xstrdup(arg);
- *strchr(sessptr, ':') = '\0';
-
- /* Try to lookup the session if present. */
- if (sessptr != NULL && *sessptr != '\0') {
- if ((s = cmd_lookup_session(cmdq, sessptr, &ambiguous)) == NULL)
- goto no_session;
- }
- if (sp != NULL)
- *sp = s;
-
- /*
- * Then work out the window. An empty string is a new window otherwise
- * try to look it up in the session.
- */
- if (*winptr == '\0')
- idx = -1;
- else if (winptr[0] == '!' && winptr[1] == '\0') {
- if ((wl = TAILQ_FIRST(&s->lastw)) == NULL)
- goto not_found;
- idx = wl->idx;
- } else if (winptr[0] == '+' || winptr[0] == '-') {
- if ((idx = cmd_find_index_offset(winptr, s, &ambiguous)) < 0)
- goto invalid_index;
- } else if ((idx = cmd_lookup_index(s, winptr, &ambiguous)) == -1)
- goto invalid_index;
-
- free(sessptr);
- return (idx);
-
- no_colon:
- /*
- * No colon in the string, first try special cases, then as a window
- * and lastly as a session.
- */
- if (arg[0] == '!' && arg[1] == '\0') {
- if ((wl = TAILQ_FIRST(&s->lastw)) == NULL)
- goto not_found;
- idx = wl->idx;
- } else if (arg[0] == '+' || arg[0] == '-') {
- if ((idx = cmd_find_index_offset(arg, s, &ambiguous)) < 0)
- goto lookup_session;
- } else if ((idx = cmd_lookup_index(s, arg, &ambiguous)) == -1)
- goto lookup_session;
-
- if (sp != NULL)
- *sp = s;
-
- return (idx);
-
- lookup_session:
- if (ambiguous)
- goto not_found;
- if (*arg != '\0' &&
- (s = cmd_lookup_session(cmdq, arg, &ambiguous)) == NULL)
- goto no_session;
-
- if (sp != NULL)
- *sp = s;
-
- return (-1);
-
- no_session:
- if (ambiguous)
- cmdq_error(cmdq, "multiple sessions: %s", arg);
- else
- cmdq_error(cmdq, "session not found: %s", arg);
- free(sessptr);
- return (-2);
-
- invalid_index:
- if (ambiguous)
- goto not_found;
- cmdq_error(cmdq, "invalid index: %s", arg);
-
- free(sessptr);
- return (-2);
-
- not_found:
- if (ambiguous)
- cmdq_error(cmdq, "multiple windows: %s", arg);
- else
- cmdq_error(cmdq, "window not found: %s", arg);
- free(sessptr);
- return (-2);
- }
-
- int
- cmd_find_index_offset(const char *winptr, struct session *s, int *ambiguous)
- {
- int idx, offset = 1;
-
- if (winptr[1] != '\0')
- offset = strtonum(winptr + 1, 1, INT_MAX, NULL);
- if (offset == 0)
- idx = cmd_lookup_index(s, winptr, ambiguous);
- else {
- if (winptr[0] == '+') {
- if (s->curw->idx == INT_MAX)
- idx = cmd_lookup_index(s, winptr, ambiguous);
- else
- idx = s->curw->idx + offset;
- } else {
- if (s->curw->idx == 0)
- idx = cmd_lookup_index(s, winptr, ambiguous);
- else
- idx = s->curw->idx - offset;
- }
- }
-
- return (idx);
- }
-
- /*
- * Find the target session, window and pane number or report an error and
- * return NULL. The pane number is separated from the session:window by a .,
- * such as mysession:mywindow.0.
- */
- struct winlink *
- cmd_find_pane(struct cmd_q *cmdq,
- const char *arg, struct session **sp, struct window_pane **wpp)
- {
- struct session *s;
- struct winlink *wl;
- struct alert *al;
- const char *period, *errstr;
- char *winptr, *paneptr;
- u_int idx;
-
- /* Get the current session. */
- if ((s = cmd_current_session(cmdq, 0)) == NULL) {
- cmdq_error(cmdq, "can't establish current session");
- return (NULL);
- }
- if (sp != NULL)
- *sp = s;
-
- /*
- * A NULL argument means the current session, window and pane, if the
- * session doesn't have any alerts associated with it though.
- */
- if (arg == NULL) {
- if (!cmd_has_session_alert(s, &al))
- return (s->curw);
- else {
- /*
- * The session has an alert associated with it. Find
- * the matching winlink in its list for the alert
- * type, and return that instead.
- */
- RB_FOREACH(wl, winlinks, &al->windows) {
- if (wl->flags & al->flag) {
- *wpp = wl->window->active;
- return (wl);
- }
- }
- /* No alert found, use the current window and pane. */
- *wpp = s->curw->window->active;
- return (s->curw);
- }
- }
-
- /* Lookup as pane id. */
- if ((*wpp = cmd_lookup_paneid(arg)) != NULL) {
- s = cmd_window_session(cmdq, (*wpp)->window, &wl);
- if (sp != NULL)
- *sp = s;
- return (wl);
- }
-
- /* Look for a separating period. */
- if ((period = strrchr(arg, '.')) == NULL)
- goto no_period;
-
- /* Pull out the window part and parse it. */
- winptr = xstrdup(arg);
- winptr[period - arg] = '\0';
- if (*winptr == '\0')
- wl = s->curw;
- else if ((wl = cmd_find_window(cmdq, winptr, sp)) == NULL)
- goto error;
-
- /* Find the pane section and look it up. */
- paneptr = winptr + (period - arg) + 1;
- if (*paneptr == '\0')
- *wpp = wl->window->active;
- else if (paneptr[0] == '+' || paneptr[0] == '-')
- *wpp = cmd_find_pane_offset(paneptr, wl);
- else if (paneptr[0] == '!' && paneptr[1] == '\0') {
- if (wl->window->last == NULL) {
- cmdq_error(cmdq, "no last pane");
- goto error;
- }
- *wpp = wl->window->last;
- } else {
- idx = strtonum(paneptr, 0, INT_MAX, &errstr);
- if (errstr != NULL)
- goto lookup_string;
- *wpp = window_pane_at_index(wl->window, idx);
- if (*wpp == NULL)
- goto lookup_string;
- }
-
- free(winptr);
- return (wl);
-
- lookup_string:
- /* Try pane string description. */
- if ((*wpp = window_find_string(wl->window, paneptr)) == NULL) {
- cmdq_error(cmdq, "can't find pane: %s", paneptr);
- goto error;
- }
-
- free(winptr);
- return (wl);
-
- no_period:
- /* Try as a pane number alone. */
- idx = strtonum(arg, 0, INT_MAX, &errstr);
- if (errstr != NULL)
- goto lookup_window;
-
- /* Try index in the current session and window. */
- if ((*wpp = window_pane_at_index(s->curw->window, idx)) == NULL)
- goto lookup_window;
-
- return (s->curw);
-
- lookup_window:
- /* Try pane string description. */
- if ((*wpp = window_find_string(s->curw->window, arg)) != NULL)
- return (s->curw);
-
- /* Try as a window and use the active pane. */
- if ((wl = cmd_find_window(cmdq, arg, sp)) != NULL)
- *wpp = wl->window->active;
- return (wl);
-
- error:
- free(winptr);
- return (NULL);
- }
-
- struct window_pane *
- cmd_find_pane_offset(const char *paneptr, struct winlink *wl)
- {
- struct window *w = wl->window;
- struct window_pane *wp = w->active;
- u_int offset = 1;
-
- if (paneptr[1] != '\0')
- offset = strtonum(paneptr + 1, 1, INT_MAX, NULL);
- if (offset > 0) {
- if (paneptr[0] == '+')
- wp = window_pane_next_by_number(w, wp, offset);
- else
- wp = window_pane_previous_by_number(w, wp, offset);
- }
-
+ *wlp = wl;
return (wp);
}
diff --cc notify.c
index f59960d,10fd5ce..efa776a
--- a/notify.c
+++ b/notify.c
@@@ -209,12 -140,11 +208,11 @@@ notify_input(struct window_pane *wp, st
* notify_input() is not queued and only does anything when
* notifications are enabled.
*/
- if (!notify_enabled)
+ if (notify_disabled)
return;
- for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- c = ARRAY_ITEM(&clients, i);
- if (c != NULL && (c->flags & CLIENT_CONTROL))
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (c->flags & CLIENT_CONTROL)
control_notify_input(c, wp, input);
}
}
diff --cc tmux.h
index c998d72,dddd4f8..be7166e
--- a/tmux.h
+++ b/tmux.h
@@@ -1083,18 -1099,7 +1113,17 @@@ struct session
RB_ENTRY(session) entry;
};
RB_HEAD(sessions, session);
- ARRAY_DECL(sessionslist, struct session *);
+/* Alert information. */
+struct alert {
+ const char *name;
+ int flag;
+ struct session *s;
+ struct winlinks windows;
+ RB_ENTRY(alert) entry;
+};
+RB_HEAD(alerts, alert);
+
/* TTY information. */
struct tty_key {
char ch;
@@@ -1480,20 -1443,25 +1504,29 @@@ struct cmd_entry
enum cmd_retval (*exec)(struct cmd *, struct cmd_q *);
};
+#define CMD_PREP_ALL_T (CMD_PREP_SESSION_T|CMD_PREP_WINDOW_T|CMD_PREP_PANE_T|
\
+ CMD_PREP_INDEX_T|CMD_PREP_SESSION_RENUM_T)
+#define CMD_PREP_ALL_S (CMD_PREP_SESSION_S|CMD_PREP_WINDOW_S|CMD_PREP_PANE_S|
\
+ CMD_PREP_INDEX_S)
- /* Key binding. */
+ /* Key binding and key table. */
struct key_binding {
- int key;
- struct cmd_list *cmdlist;
- int can_repeat;
+ int key;
+ struct cmd_list *cmdlist;
+ int can_repeat;
- RB_ENTRY(key_binding) entry;
+ RB_ENTRY(key_binding) entry;
};
RB_HEAD(key_bindings, key_binding);
+ struct key_table {
+ const char *name;
+ struct key_bindings key_bindings;
+
+ u_int references;
+
+ RB_ENTRY(key_table) entry;
+ };
+ RB_HEAD(key_tables, key_table);
/*
* Option table entries. The option table is the user-visible part of the
@@@ -1576,27 -1542,16 +1609,26 @@@ void format_free(struct format_tree
*
void printflike(3, 4) format_add(struct format_tree *, const char *,
const char *, ...);
const char *format_find(struct format_tree *, const char *);
+ char *format_expand_time(struct format_tree *, const char *, time_t);
char *format_expand(struct format_tree *, const char *);
- void format_session(struct format_tree *, struct session *);
- void format_client(struct format_tree *, struct client *);
- void format_window(struct format_tree *, struct window *);
- void format_winlink(struct format_tree *, struct session *,
- struct winlink *);
- void format_window_pane(struct format_tree *,
+ void format_defaults(struct format_tree *, struct client *,
+ struct session *, struct winlink *, struct window_pane *);
+ void format_defaults_window(struct format_tree *, struct window *);
+ void format_defaults_pane(struct format_tree *,
struct window_pane *);
- void format_paste_buffer(struct format_tree *,
+ void format_defaults_paste_buffer(struct format_tree *,
struct paste_buffer *, int);
+/* hooks.c */
+int hooks_cmp(struct hook *, struct hook *);
+RB_PROTOTYPE(hooks_tree, hook, entry, hooks_cmp);
+void hooks_init(struct hooks *, struct hooks *);
+void hooks_free(struct hooks *);
+void hooks_add(struct hooks *, const char *, struct cmd_list *);
+void hooks_copy(struct hooks *, struct hooks *);
+void hooks_remove(struct hooks *, struct hook *);
+struct hook *hooks_find(struct hooks *, const char *);
+
/* mode-key.c */
extern const struct mode_key_table mode_key_tables[];
extern struct mode_key_tree mode_key_tree_vi_edit;
@@@ -1793,13 -1760,13 +1840,14 @@@ char **cmd_copy_argv(int, char *
void cmd_free_argv(int, char **);
char *cmd_stringify_argv(int, char **);
struct cmd *cmd_parse(int, char **, const char *, u_int, char **);
+int cmd_prepare_state(struct cmd *, struct cmd_q *);
size_t cmd_print(struct cmd *, char *, size_t);
- struct session *cmd_current_session(struct cmd_q *, int);
- struct client *cmd_current_client(struct cmd_q *);
+ int cmd_mouse_at(struct window_pane *, struct mouse_event *,
+ u_int *, u_int *, int);
+ struct winlink *cmd_mouse_window(struct mouse_event *, struct session
**);
+ struct window_pane *cmd_mouse_pane(struct mouse_event *, struct session **,
+ struct winlink **);
char *cmd_template_replace(const char *, const char *, int);
- struct window *cmd_lookup_windowid(const char *);
- struct window_pane *cmd_lookup_paneid(const char *);
extern const struct cmd_entry *cmd_table[];
extern const struct cmd_entry cmd_attach_session_entry;
extern const struct cmd_entry cmd_bind_key_entry;
@@@ -1903,13 -1869,13 +1951,15 @@@ struct cmd_q *cmdq_new(struct client *)
int cmdq_free(struct cmd_q *);
void printflike(2, 3) cmdq_print(struct cmd_q *, const char *, ...);
void printflike(2, 3) cmdq_error(struct cmd_q *, const char *, ...);
- int cmdq_guard(struct cmd_q *, const char *, int);
- void cmdq_run(struct cmd_q *, struct cmd_list *);
- void cmdq_append(struct cmd_q *, struct cmd_list *);
+ void cmdq_guard(struct cmd_q *, const char *, int);
+ void cmdq_run(struct cmd_q *, struct cmd_list *,
+ struct mouse_event *);
+ void cmdq_append(struct cmd_q *, struct cmd_list *,
+ struct mouse_event *);
int cmdq_continue(struct cmd_q *);
void cmdq_flush(struct cmd_q *);
+int cmdq_hooks_run(struct hooks *, const char *, const char *,
+ struct cmd_q *);
/* cmd-string.c */
int cmd_string_parse(const char *, struct cmd_list **, const char *,
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 3 +-
TODO | 18 +-
cfg.c | 51 ++-
client.c | 21 +-
cmd-attach-session.c | 37 +-
cmd-bind-key.c | 44 ++-
cmd-break-pane.c | 6 +-
cmd-capture-pane.c | 2 +-
cmd-choose-buffer.c | 2 +-
cmd-choose-client.c | 27 +-
cmd-clock-mode.c | 43 --
cmd-command-prompt.c | 2 +-
cmd-confirm-before.c | 2 +-
cmd-copy-mode.c | 34 ++-
cmd-detach-client.c | 40 +-
cmd-display-message.c | 6 +-
cmd-find-window.c | 4 +-
cmd-find.c | 1117 ++++++++++++++++++++++++++++++++++++++++++++
cmd-if-shell.c | 52 ++-
cmd-list-buffers.c | 2 +-
cmd-list-clients.c | 18 +-
cmd-list-keys.c | 86 ++--
cmd-list-panes.c | 4 +-
cmd-list-sessions.c | 2 +-
cmd-list-windows.c | 4 +-
cmd-load-buffer.c | 2 +-
cmd-move-window.c | 18 +-
cmd-new-session.c | 5 +-
cmd-new-window.c | 10 +-
cmd-pipe-pane.c | 20 +-
cmd-queue.c | 28 +-
cmd-resize-pane.c | 66 +++-
cmd-respawn-pane.c | 2 +-
cmd-run-shell.c | 19 +-
cmd-save-buffer.c | 2 +-
cmd-select-layout.c | 68 ++-
cmd-select-pane.c | 38 ++-
cmd-send-keys.c | 21 +-
cmd-set-option.c | 52 ++-
cmd-show-messages.c | 5 +-
cmd-split-window.c | 18 +-
cmd-switch-client.c | 22 +-
cmd-unbind-key.c | 37 +-
cmd.c | 1030 ++--------------------------------------
colour.c | 18 +-
compat/getopt.c | 4 +-
configure.ac | 2 +
control-notify.c | 30 +-
control.c | 2 +-
environ.c | 7 +-
format.c | 154 +++++--
grid.c | 2 +-
input-keys.c | 98 ++--
input.c | 14 +-
job.c | 5 +-
key-bindings.c | 129 ++++--
key-string.c | 17 +-
layout-custom.c | 4 +-
layout.c | 52 --
logo/LICENSE | 13 +
logo/favicon.ico | Bin 0 -> 6518 bytes
logo/tmux-logo-1-color.eps | 922 ++++++++++++++++++++++++++++++++++++
logo/tmux-logo-1-color.svg | 18 +
logo/tmux-logo-huge.png | Bin 0 -> 47121 bytes
logo/tmux-logo-large.png | Bin 0 -> 12190 bytes
logo/tmux-logo-medium.png | Bin 0 -> 5400 bytes
logo/tmux-logo-small.png | Bin 0 -> 2701 bytes
logo/tmux-logo.eps | 925 ++++++++++++++++++++++++++++++++++++
logo/tmux-logo.svg | 18 +
logo/tmux-logomark.eps | 829 ++++++++++++++++++++++++++++++++
logo/tmux-logomark.svg | 15 +
mode-key.c | 14 +
names.c | 4 +-
notify.c | 12 +-
options-table.c | 101 ++---
options.c | 18 +-
paste.c | 6 +-
resize.c | 14 +-
screen-redraw.c | 22 +-
server-client.c | 550 ++++++++++++++--------
server-fn.c | 73 +--
server-window.c | 60 +--
server.c | 117 ++---
session.c | 22 +-
status.c | 140 +++---
style.c | 38 +-
tmux.1 | 494 +++++++++++++-------
tmux.c | 5 +-
tmux.h | 257 ++++++----
tty-keys.c | 81 +---
tty-term.c | 2 +
tty.c | 236 +++++++---
utf8.c | 4 +-
window-choose.c | 115 ++---
window-clock.c | 8 +-
window-copy.c | 252 +++++-----
window.c | 240 +++++-----
www/favicon.ico | Bin 0 -> 6518 bytes
www/index.html.in | 2 +-
www/logo.png | Bin 0 -> 2701 bytes
www/main.css | 5 +
101 files changed, 6469 insertions(+), 2791 deletions(-)
delete mode 100644 cmd-clock-mode.c
create mode 100644 cmd-find.c
create mode 100644 logo/LICENSE
create mode 100644 logo/favicon.ico
create mode 100644 logo/tmux-logo-1-color.eps
create mode 100644 logo/tmux-logo-1-color.svg
create mode 100644 logo/tmux-logo-huge.png
create mode 100644 logo/tmux-logo-large.png
create mode 100644 logo/tmux-logo-medium.png
create mode 100644 logo/tmux-logo-small.png
create mode 100644 logo/tmux-logo.eps
create mode 100644 logo/tmux-logo.svg
create mode 100644 logo/tmux-logomark.eps
create mode 100644 logo/tmux-logomark.svg
create mode 100644 www/favicon.ico
create mode 100644 www/logo.png
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs