Seems more useful than what we have, applied thanks.

On Mon, Jun 23, 2014 at 07:32:28PM +0100, Balazs Kezes wrote:
> On 2014-06-23 08:04 +0100, Nicholas Marriott wrote:
> > Well, I'm not sure what we can or should do about that. And in fact if
> > we're going to copy without ACS maybe we should continue to display
> > the characters without ACS.
> 
> Not sure about the "should" part but would something along these lines
> work?
> 
> 
> diff --git a/screen-write.c b/screen-write.c
> index 325fb9a..8c059d1 100644
> --- a/screen-write.c
> +++ b/screen-write.c
> @@ -990,6 +990,8 @@ screen_write_cell(struct screen_write_ctx *ctx, const 
> struct grid_cell *gc)
>               memcpy(&tmp_gc, &s->sel.cell, sizeof tmp_gc);
>               grid_cell_get(gc, &ud);
>               grid_cell_set(&tmp_gc, &ud);
> +             tmp_gc.attr = tmp_gc.attr & ~GRID_ATTR_CHARSET;
> +             tmp_gc.attr |= gc->attr & GRID_ATTR_CHARSET;
>               tmp_gc.flags = gc->flags & ~(GRID_FLAG_FG256|GRID_FLAG_BG256);
>               tmp_gc.flags |= s->sel.cell.flags &
>                   (GRID_FLAG_FG256|GRID_FLAG_BG256);
> diff --git a/tty-acs.c b/tty-acs.c
> index ae84f0d..140ad4d 100644
> --- a/tty-acs.c
> +++ b/tty-acs.c
> @@ -81,7 +81,7 @@ tty_acs_get(struct tty *tty, u_char ch)
>       struct tty_acs_entry *entry;
>  
>       /* If not a UTF-8 terminal, use the ACS set. */
> -     if (!(tty->flags & TTY_UTF8)) {
> +     if (tty != NULL && !(tty->flags & TTY_UTF8)) {
>               if (tty->term->acs[ch][0] == '\0')
>                       return (NULL);
>               return (&tty->term->acs[ch][0]);
> diff --git a/window-copy.c b/window-copy.c
> index 0775bcb..d1eb7d0 100644
> --- a/window-copy.c
> +++ b/window-copy.c
> @@ -1579,6 +1579,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)) {
> +                             const char *acs = tty_acs_get(NULL, ud.data[0]);
> +                             if (acs != NULL) {
> +                                     strcpy(ud.data, acs);
> +                                     ud.size = strlen(acs);
> +                             }
> +                     }
>  
>                       *buf = xrealloc(*buf, 1, (*off) + ud.size);
>                       memcpy(*buf + *off, ud.data, ud.size);
> 
> -- 
> Balazs

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to