summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-send-keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-send-keys.c')
-rw-r--r--usr.bin/tmux/cmd-send-keys.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-send-keys.c b/usr.bin/tmux/cmd-send-keys.c
index 4bc3c6ab64c..e2fa826494d 100644
--- a/usr.bin/tmux/cmd-send-keys.c
+++ b/usr.bin/tmux/cmd-send-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-send-keys.c,v 1.34 2016/11/29 12:54:46 nicm Exp $ */
+/* $OpenBSD: cmd-send-keys.c,v 1.35 2016/12/08 22:15:37 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -63,7 +63,8 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
struct window_pane *wp = item->state.tflag.wp;
struct session *s = item->state.tflag.s;
struct mouse_event *m = &item->mouse;
- const u_char *keystr;
+ struct utf8_data *ud, *uc;
+ wchar_t wc;
int i, literal;
key_code key;
u_int np = 1;
@@ -124,8 +125,12 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
literal = 1;
}
if (literal) {
- for (keystr = args->argv[i]; *keystr != '\0'; keystr++)
- window_pane_key(wp, NULL, s, *keystr, NULL);
+ ud = utf8_fromcstr(args->argv[i]);
+ for (uc = ud; uc->size != 0; uc++) {
+ if (utf8_combine(uc, &wc) == UTF8_DONE)
+ window_pane_key(wp, NULL, s, wc, NULL);
+ }
+ free(ud);
}
}