commit 4abecf9ce46680bf5dd3824554eb0a506bb51524 from: Christoph Lohmann <20h@r-36.net> date: Sun Oct 28 05:32:54 2012 UTC Applying the patch of Rafa Garcia Gallega to not emulate the vt100 behaviour of selecting all whitespaces. Thanks! commit - 5de1468554c98ed8a40ac3d1e5d5c7db2eb1480b commit + 4abecf9ce46680bf5dd3824554eb0a506bb51524 blob - e19cefd949c60886de515b4fad18b09b2232fa52 blob + 3cd78310a5985d04386099d255c1ef3de54f9311 --- st.c +++ st.c @@ -678,7 +678,7 @@ bpress(XEvent *e) { void selcopy(void) { - char *str, *ptr, *p; + char *str, *ptr; int x, y, bufsize, is_selected = 0, size; Glyph *gp; @@ -693,11 +693,12 @@ selcopy(void) { for(x = 0; x < term.col; x++) { gp = &term.line[y][x]; - if(!(is_selected = selected(x, y))) + if(!(is_selected = selected(x, y)) + || !(gp->state & GLYPH_SET)) { continue; - p = (gp->state & GLYPH_SET) ? gp->c : " "; - size = utf8size(p); - memcpy(ptr, p, size); + } + size = utf8size(gp->c); + memcpy(ptr, gp->c, size); ptr += size; } /* \n at the end of every selected line except for the last one */