diff --git a/cmd.c b/cmd.c index eecac462..282fb112 100644 --- a/cmd.c +++ b/cmd.c @@ -294,8 +294,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 diff --git a/input-keys.c b/input-keys.c index faa7bd17..7582a638 100644 --- a/input-keys.c +++ b/input-keys.c @@ -226,7 +226,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; diff --git a/screen-write.c b/screen-write.c index b423df71..ae89293b 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); diff --git a/screen.c b/screen.c index e92c6aa7..39720f4e 100644 --- a/screen.c +++ b/screen.c @@ -366,7 +366,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; } diff --git a/tmux.1 b/tmux.1 index 7f783b86..5132a189 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3540,7 +3540,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 diff --git a/tmux.h b/tmux.h index e4994170..e6c3bbc0 100644 --- a/tmux.h +++ b/tmux.h @@ -39,6 +39,9 @@ extern char *__progname; extern char **environ; +/* Default global configuration file. */ +#define TMUX_CONF "/etc/tmux.conf" + /* Default prompt history length. */ #define PROMPT_HISTORY 100