From a8e2d851feba7934d500520946ab5e366b6dfe90 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 16 Nov 2016 11:41:17 +0000 Subject: [PATCH 1/2] Don't error if renaming a session to its current name, from shik dot chen at gmail dot com. --- cmd-rename-session.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd-rename-session.c b/cmd-rename-session.c index bf180f91..0c250aa6 100644 --- a/cmd-rename-session.c +++ b/cmd-rename-session.c @@ -19,6 +19,7 @@ #include #include +#include #include "tmux.h" @@ -50,6 +51,9 @@ cmd_rename_session_exec(struct cmd *self, struct cmdq_item *item) const char *newname; newname = args->argv[0]; + if (strcmp(newname, s->name) == 0) + return (CMD_RETURN_NORMAL); + if (!session_check_name(newname)) { cmdq_error(item, "bad session name: %s", newname); return (CMD_RETURN_ERROR); From ddf7ac5ae4d044cda12d959bbf02df921f9d84a5 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 16 Nov 2016 13:31:22 +0000 Subject: [PATCH 2/2] Fix calculation of whether we need a region for drawing a cell (only if full width and at the edge of the region), otherwise clear the region entirely. --- tty.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index 6fade4c9..c217b0ff 100644 --- a/tty.c +++ b/tty.c @@ -1004,7 +1004,7 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx) * off the edge - if so, move the cursor back to the right. */ if (ctx->xoff + ctx->ocx > tty->rright) - tty_cursor(tty, tty->rright, ctx->yoff + ctx->ocy); + tty_cursor(tty, tty->rright, tty->rlower); else tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); @@ -1134,8 +1134,12 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) struct screen *s = wp->screen; u_int cx, width; - if (ctx->ocy == ctx->orlower) + if (ctx->xoff + ctx->ocx > tty->sx - 1 && + ctx->yoff + ctx->ocy == ctx->orlower && + tty_pane_full_width(tty, ctx)) tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); + else + tty_region_off(tty); tty_margin_off(tty); /* Is the cursor in the very last position? */