[BUG] multiline select behaviour of busybox shell in xterm

Denys Vlasenko vda.linux at googlemail.com
Thu Feb 28 15:10:33 UTC 2013


On Fri, Feb 1, 2013 at 7:25 PM, John Spencer
<maillist-busybox at barfooze.de> wrote:
> everytime i chroot into a busybox environment, i notice a weird behaviour in
> xterm:
>
> 1) selecting text that spans over more than one line using a double-click
> will only select the half of the text that is in the currently selected line
>
> for example, if the terminal width is 10 chars:
> 12345678 A
> BCD
> where ABCD is a complete word without line breaks, double-clicking on A will
> only select A, whereas using coreutils+bash, ABCD will be selected.
>
>
> 2) the other case is selecting multiple lines, for example a long gcc
> statement, using the busybox environment the copied text has embedded
> newline characters on the terminal line boundaries whereas on a typical gnu
> system it does not.
>
> so if you want to copy/paste such a long command to reuse it in another
> terminal, you have to paste it into an editor first, remove the line breaks
> and copy it from there again. this is quite annoying.

selecting text is handled by xterms, and unless xterm is trying to be extremely
clever, it decides about such things as you described merely by looking at
its current text matrix. I.e. it has no idea how the text ended up there:
whether there was a line break or not.

In my experience most xterms decide "if the last char on the line
is not a space and the first one on next line is not a space, then
assume it was a screen-wrapped word".

On your bbox machine, you might have one which doesn't use
this heuristic.
-- 
vda


More information about the busybox mailing list