Skip to content

Commit

Permalink
Merge branch 'obsd-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Jan 16, 2023
2 parents 42895ef + eb1f8d7 commit 789cb91
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd-send-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ cmd_send_keys_inject_key(struct cmdq_item *item, struct cmdq_item *after,
if (tc == NULL)
return (item);
event = xmalloc(sizeof *event);
event->key = key;
event->key = key|KEYC_SENT;
memset(&event->m, 0, sizeof event->m);
if (server_client_handle_key(tc, event) == 0)
free(event);
Expand Down
2 changes: 2 additions & 0 deletions key-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ key_string_lookup_key(key_code key, int with_flags)
strlcat(out, "B", sizeof out);
if (saved & KEYC_EXTENDED)
strlcat(out, "E", sizeof out);
if (saved & KEYC_SENT)
strlcat(out, "S", sizeof out);
strlcat(out, "]", sizeof out);
}
return (out);
Expand Down
4 changes: 3 additions & 1 deletion server-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,9 @@ server_client_key_callback(struct cmdq_item *item, void *data)
goto forward_key;

/* Treat everything as a regular key when pasting is detected. */
if (!KEYC_IS_MOUSE(key) && server_client_assume_paste(s))
if (!KEYC_IS_MOUSE(key) &&
(~key & KEYC_SENT) &&
server_client_assume_paste(s))
goto forward_key;

/*
Expand Down
11 changes: 6 additions & 5 deletions tmux.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ struct winlink;
#define KEYC_SHIFT 0x00400000000000ULL

/* Key flag bits. */
#define KEYC_LITERAL 0x01000000000000ULL
#define KEYC_KEYPAD 0x02000000000000ULL
#define KEYC_CURSOR 0x04000000000000ULL
#define KEYC_LITERAL 0x01000000000000ULL
#define KEYC_KEYPAD 0x02000000000000ULL
#define KEYC_CURSOR 0x04000000000000ULL
#define KEYC_IMPLIED_META 0x08000000000000ULL
#define KEYC_BUILD_MODIFIERS 0x10000000000000ULL
#define KEYC_VI 0x20000000000000ULL
#define KEYC_EXTENDED 0x40000000000000ULL
#define KEYC_VI 0x20000000000000ULL
#define KEYC_EXTENDED 0x40000000000000ULL
#define KEYC_SENT 0x80000000000000ULL

/* Masks for key bits. */
#define KEYC_MASK_MODIFIERS 0x00f00000000000ULL
Expand Down

0 comments on commit 789cb91

Please sign in to comment.