Bug#1128961: xterm: selection not fully cleared after text changes
Thomas Dickey <[email protected]>
| Newsgroups | gmane.linux.debian.devel.x |
|---|---|
| Message-ID | <aeOvhTnBBff-fEO9__38039.3730987393$1776529406$gmane$org@prl-debianold-64.jexium-island.net> |
On Fri, Apr 17, 2026 at 03:35:17PM +0200, Vincent Lefevre wrote:
> On 2026-04-14 03:38:55 -0400, Thomas Dickey wrote:
> > fixed in #409
>
> Thanks, this has much improved, but the behavior is still strange.
> For instance, after selecting the full body
>
> ----------------------------------------
> z
>
> 1234
> 123456
> 12345678
> 1234567
> 12
>
> 123456
> 1234
> 12
> ----------------------------------------
>
> and typing the <Down> key, the first two lines ("z" and the blank
> line that follows) are still selected. In case this is regarded
> as an expected behavior to keep a common part of the selection,
> this is inconsistent, because when I type the <Up> key to go back
> to the first message, the selection is entirely cleared.
That's "expected behavior". In the example you reported, ncurses is
setting a scrolling region in the middle of the screen. It does that
to move some lines up or down - and the selection moved with the text.
Refer to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=291787
I added a feature (which I did make configurable "keepSelection") that
tells xterm to try to keep the selection/highlighting when outputs to
the screen don't actually modify the content of the selection. I allowed
for scrolling (which may truncate the selection but not otherwise alter
it). But in implementing it, I overlooked a few of the controls that could
make the text scroll. As a result, the highlighting wasn't being updated
properly. That is what you saw in the bug report.
The remaining highlighting (recalling from your example) is truncated
from the initial selection (because of the scrolling operations).
I wrote a test driver to investigate this.
Most terminals simply drop the selection/highlighting on any output to the
terminal (some don't implement the scrolling correctly anyway).
PuTTY (not mintty) and TeraTerm do (partly -- for instance, I see in a quick
check they simply drop the selection when it straddles a scrolling region
margin).
--
Thomas E. Dickey <[email protected]>
https://invisible-island.net
signature.asc
(application/pgp-signature, 659 B)
-----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGYgtkt2kxADCLA1WzCr0RyFnvgMFAmnjr4EACgkQzCr0RyFn vgPQeQv+LlO3przIzvXrVrPYLlTyupuXojFDcO3kyLZYIXM0nL9kMphpuEmp5Bs9 eKzgIkkYe3QY5wpTF5I+RMUadVkRiS2h90S0Fg9lj7pz9EBeoLK5yVPyjU8FnYug fnUXfI05eBOmnBqt2jfxUeeTc0plaIrxgr52QxGdcrKN9YGeZ8UA5Oo9qeaYrFuu Adt96L0/twHF3mFehfC431t/2PD0M2/VEXdHaOG3nl7AvL9K8kYMZdbvWzfIv1vq 9WuJlJ5yXZBCQbPAIteknXNIUhkpxeeNp3O4shcCWmVUSAoWx0Iid0maxALaoWiQ w6f87GcehUD19zgS4MmSve/HF7l058ehRt+UWZ/uxuH8qLoYHw7NdNb5klPjpbPX UGxl54Wbla1BRnAHKrjYZRqOyElwiD8Dq6cKbMT3Uz8WI8u/3dGLLo01aOk67f5C pFR3Qs5gqXvUMN8XixSLvMnCYkVrcj1jgkis9j2IOPQsKCwsaVqIu3Y1PowEBPfk LALjRjeD =1BxP -----END PGP SIGNATURE-----