aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-12-07 10:01:12 +0000
committerThomas Adam <thomas@xteddy.org>2016-12-07 10:01:12 +0000
commitb9fa8f12d7b56a331a53f347bfe81e62ca351dc5 (patch)
tree29f9b29568df79c75e3bb08a0405a7b1210d48a0
parent6749a30a6e1a6467b8ce688cc5c1c245224ef013 (diff)
parent5ea143f521726a47fd5092dcc3abf9101af32751 (diff)
downloadrtmux-b9fa8f12d7b56a331a53f347bfe81e62ca351dc5.tar.gz
rtmux-b9fa8f12d7b56a331a53f347bfe81e62ca351dc5.tar.bz2
rtmux-b9fa8f12d7b56a331a53f347bfe81e62ca351dc5.zip
Merge branch 'obsd-master'
-rw-r--r--key-bindings.c2
-rw-r--r--server-client.c24
-rw-r--r--tty.c3
3 files changed, 17 insertions, 12 deletions
diff --git a/key-bindings.c b/key-bindings.c
index e8eedca5..25290a4a 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -238,6 +238,7 @@ key_bindings_init(void)
"bind -Tcopy-mode C-c send -X cancel",
"bind -Tcopy-mode C-e send -X end-of-line",
"bind -Tcopy-mode C-f send -X cursor-right",
+ "bind -Tcopy-mode C-b send -X cursor-left",
"bind -Tcopy-mode C-g send -X clear-selection",
"bind -Tcopy-mode C-k send -X copy-end-of-line",
"bind -Tcopy-mode C-n send -X cursor-down",
@@ -300,6 +301,7 @@ key_bindings_init(void)
"bind -Tcopy-mode-vi C-c send -X cancel",
"bind -Tcopy-mode-vi C-d send -X halfpage-down",
"bind -Tcopy-mode-vi C-e send -X scroll-down",
+ "bind -Tcopy-mode-vi C-b send -X page-up",
"bind -Tcopy-mode-vi C-f send -X page-down",
"bind -Tcopy-mode-vi C-h send -X cursor-left",
"bind -Tcopy-mode-vi C-j send -X copy-selection-and-cancel",
diff --git a/server-client.c b/server-client.c
index 065e31d0..7cfdca07 100644
--- a/server-client.c
+++ b/server-client.c
@@ -780,6 +780,18 @@ retry:
else
log_debug("key table %s (pane %%%u)", table->name, wp->id);
+ /*
+ * The prefix always takes precedence and forces a switch to the prefix
+ * table, unless we are already there.
+ */
+ if ((key == (key_code)options_get_number(s->options, "prefix") ||
+ key == (key_code)options_get_number(s->options, "prefix2")) &&
+ strcmp(table->name, "prefix") != 0) {
+ server_client_set_key_table(c, "prefix");
+ server_status_client(c);
+ return;
+ }
+
/* Try to see if there is a key binding in the current table. */
bd_find.key = key;
bd = RB_FIND(key_bindings, &table->key_bindings, &bd_find);
@@ -852,22 +864,12 @@ retry:
/* If no match and we're not in the root table, that's it. */
if (name == NULL && !server_client_is_default_key_table(c)) {
+ log_debug("no key in key table %s", table->name);
server_client_set_key_table(c, NULL);
server_status_client(c);
return;
}
- /*
- * No match, but in the root table. Prefix switches to the prefix table
- * and everything else is passed through.
- */
- if (key == (key_code)options_get_number(s->options, "prefix") ||
- key == (key_code)options_get_number(s->options, "prefix2")) {
- server_client_set_key_table(c, "prefix");
- server_status_client(c);
- return;
- }
-
forward:
if (c->flags & CLIENT_READONLY)
return;
diff --git a/tty.c b/tty.c
index 014a99fb..e4629813 100644
--- a/tty.c
+++ b/tty.c
@@ -1153,7 +1153,8 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1);
else
tty_cursor_pane(tty, ctx, 0, ctx->ocy);
- } else if (tty->cx != tty->sx - 1) {
+ } else if (tty->cy != ctx->yoff + ctx->ocy ||
+ tty->cx < tty->sx) {
/*
* The cursor isn't in the last position already, so
* move as far right as possible and redraw the last