summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/window-copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
-rw-r--r--usr.bin/tmux/window-copy.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 6cefc9e8af4..bc650e9a399 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.114 2014/09/01 21:50:18 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.115 2014/10/02 08:36:26 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1552,6 +1552,7 @@ window_copy_copy_line(struct window_pane *wp,
struct grid_line *gl;
struct utf8_data ud;
u_int i, xx, wrapped = 0;
+ const char *s;
if (sx > ex)
return;
@@ -1580,6 +1581,13 @@ window_copy_copy_line(struct window_pane *wp,
if (gc->flags & GRID_FLAG_PADDING)
continue;
grid_cell_get(gc, &ud);
+ if (ud.size == 1 && (gc->attr & GRID_ATTR_CHARSET)) {
+ s = tty_acs_get(NULL, ud.data[0]);
+ if (s != NULL && strlen(s) <= sizeof ud.data) {
+ ud.size = strlen(s);
+ memcpy (ud.data, s, ud.size);
+ }
+ }
*buf = xrealloc(*buf, 1, (*off) + ud.size);
memcpy(*buf + *off, ud.data, ud.size);