From e323101edede281b65e3c7141d79afdb2501a8ea Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Apr 2013 10:01:32 +0000 Subject: [PATCH 1/6] Rename global configuration define. --- server.c | 8 ++++---- tmux.c | 2 +- tmux.h | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/server.c b/server.c index a07fa1fd..ffc25db0 100644 --- a/server.c +++ b/server.c @@ -169,13 +169,13 @@ server_start(int lockfd, char *lockfile) cfg_references = 1; ARRAY_INIT(&cfg_causes); - if (access(SYSTEM_CFG, R_OK) == 0) { - if (load_cfg(SYSTEM_CFG, cfg_cmd_q, &cause) == -1) { - xasprintf(&cause, "%s: %s", SYSTEM_CFG, cause); + if (access(TMUX_CONF, R_OK) == 0) { + if (load_cfg(TMUX_CONF, cfg_cmd_q, &cause) == -1) { + xasprintf(&cause, "%s: %s", TMUX_CONF, cause); ARRAY_ADD(&cfg_causes, cause); } } else if (errno != ENOENT) { - xasprintf(&cause, "%s: %s", SYSTEM_CFG, strerror(errno)); + xasprintf(&cause, "%s: %s", TMUX_CONF, strerror(errno)); ARRAY_ADD(&cfg_causes, cause); } if (cfg_file != NULL) { diff --git a/tmux.c b/tmux.c index e9b28d7e..b229967d 100644 --- a/tmux.c +++ b/tmux.c @@ -357,7 +357,7 @@ main(int argc, char **argv) if (pw != NULL) home = pw->pw_dir; } - xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG); + xasprintf(&cfg_file, "%s/.tmux.conf", home); if (access(cfg_file, R_OK) != 0 && errno == ENOENT) { free(cfg_file); cfg_file = NULL; diff --git a/tmux.h b/tmux.h index 8fb06223..7404b27f 100644 --- a/tmux.h +++ b/tmux.h @@ -43,9 +43,8 @@ extern char *__progname; extern char **environ; -/* Default configuration files. */ -#define DEFAULT_CFG ".tmux.conf" -#define SYSTEM_CFG "/etc/tmux.conf" +/* Default global configuration file. */ +#define TMUX_CONF "/etc/tmux.conf" /* Default prompt history length. */ #define PROMPT_HISTORY 100 From 2555ac58ccc9b5e9c188dcb3a3a4cce6aa4821d1 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 24 Apr 2013 10:15:47 +0000 Subject: [PATCH 2/6] .Op Fl b not .Fl b for run-shell synopsis, from Ben Boeckel. --- tmux.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.1 b/tmux.1 index b38b43bb..9b874f7b 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3536,7 +3536,7 @@ Lock each client individually by running the command specified by the .Ic lock-command option. .It Xo Ic run-shell -.Fl b +.Op Fl b .Op Fl t Ar target-pane .Ar shell-command .Xc From 66f4c60a8477e0cf9eb059e7687ca524f135e442 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 7 May 2013 11:00:16 +0000 Subject: [PATCH 3/6] Don't limit width and height to 222 in standard mouse mode. --- input-keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input-keys.c b/input-keys.c index d7e8513d..2de48e97 100644 --- a/input-keys.c +++ b/input-keys.c @@ -227,7 +227,7 @@ input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m) len += utf8_split2(m->x + 33, &buf[len]); len += utf8_split2(m->y + 33, &buf[len]); } else { - if (m->xb > 223 || m->x >= 222 || m->y > 222) + if (m->xb > 223) return; len = xsnprintf(buf, sizeof buf, "\033[M"); buf[len++] = m->xb + 32; From 772d61f3ed762a50ea4436b7fb70e7024674e6c6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 May 2013 15:32:14 +0000 Subject: [PATCH 4/6] RIS should reset focus reporting, from Hayaki Saito. --- screen-write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screen-write.c b/screen-write.c index c0935c95..7fcfc5ee 100644 --- a/screen-write.c +++ b/screen-write.c @@ -56,7 +56,7 @@ screen_write_reset(struct screen_write_ctx *ctx) screen_reset_tabs(s); screen_write_scrollregion(ctx, 0, screen_size_y(s) - 1); - s->mode &= ~(MODE_INSERT|MODE_KCURSOR|MODE_KKEYPAD); + s->mode &= ~(MODE_INSERT|MODE_KCURSOR|MODE_KKEYPAD|MODE_FOCUSON); s->mode &= ~(ALL_MOUSE_MODES|MODE_MOUSE_UTF8|MODE_MOUSE_SGR); screen_write_clearscreen(ctx); From 25c430b1cd25d64c52d1c14834957abfaaeb69b6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 May 2013 15:34:09 +0000 Subject: [PATCH 5/6] Reserve space for \0 in cmd_print, from George Nachman. --- cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd.c b/cmd.c index d0348704..e7290f26 100644 --- a/cmd.c +++ b/cmd.c @@ -295,8 +295,8 @@ cmd_print(struct cmd *cmd, char *buf, size_t len) size_t off, used; off = xsnprintf(buf, len, "%s ", cmd->entry->name); - if (off < len) { - used = args_print(cmd->args, buf + off, len - off); + if (off + 1 < len) { + used = args_print(cmd->args, buf + off, len - off - 1); if (used == 0) off--; else From 88a4da97478ec6b4b2f361315a5a183333d0aa3f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 15 May 2013 15:39:51 +0000 Subject: [PATCH 6/6] Don't let cursor position overflow when reflowing, from Christopher Collins. --- screen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/screen.c b/screen.c index 754effc2..76aa91c6 100644 --- a/screen.c +++ b/screen.c @@ -365,7 +365,13 @@ void screen_reflow(struct screen *s, u_int new_x) { struct grid *old = s->grid; + u_int change; s->grid = grid_create(old->sx, old->sy, old->hlimit); - s->cy -= grid_reflow(s->grid, old, new_x); + + change = grid_reflow(s->grid, old, new_x); + if (change < s->cy) + s->cy -= change; + else + s->cy = 0; }