[BRLTTY] Preserving presentation when copying to the clipboard

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Sun Mar 30 19:36:23 UTC 2025


Hello,

Dave Mielke (2025/03/30 12:53 -0400):
> [quoted lines by Sébastien Hinderer on 2025/03/30 at 15:33 +0200]
> 
> >We believe that, currently, it is not really possible to preserve the
> >presentation of, say, a block of code when it gets copied to the
> >clipboard.
> 
> I haven't had a problem with this. You need to do a rectangular copy.

I just tried this, in a virtual ocnsole.

Assume the following program:

#include <stdio.h>
#include <stdlib.h>

int main()
{
  prinf("Short line\n");
  prinf("A looooooooooonger line\n");
  printf("OK\n");
  return 0.
}

Imagine I would like to duplicate the block consisting of the three
printf lines. First, I CLIP_NEW on the 'p' of the first printf. Then, I
COPY_RECT on the semicolon that terminates, the third line. IfI do that,
here is what I get:

prinf("Short line\n"); prinf("A looooooooooonger line\n");
printf("OK\n");

> Also, you need to ensure that autoindentaton is turned off in the
> editor.

It is.
 
> >If the copy is done in a linear way then the end of lines are removed
> 
> Yes.
> 
> >whereas, if rectangular copy is used one gets a geometric rectangle,
> >which may include spaces one does not really care about.
> 
> Which spaces. I believe (will have to refresh my memory, though) that
> trailing blanks are removed.

Well here I think the situation is a bit different because the last line
is shorter than the first so there are not extra spaces. And I confirm
that so far I have not been able to reproduce the superfluous spaces
situation.

Seb.


More information about the BRLTTY mailing list