After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765276 - Fails to copy first line of multi-line selection, in single click selection mode
Fails to copy first line of multi-line selection, in single click selection mode
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.44.x
Other Linux
: Normal normal
: vte-0-44
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-19 21:44 UTC by Robert Edmonds
Modified: 2016-05-09 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screen recording of expected behavior (2.35 MB, video/webm)
2016-04-19 21:47 UTC, Robert Edmonds
Details
Screen recording of buggy behavior (2.45 MB, video/webm)
2016-04-19 21:48 UTC, Robert Edmonds
Details

Description Robert Edmonds 2016-04-19 21:44:15 UTC
Hi,

In the single click selection mode, the first line of a multi-line selection is replaced with a blank line when pasted. This is a regression from previous versions where the copied text would match the visible selection.

One workaround is to begin or end the selection by precisely hovering the pointer over the leftmost column on the first line of the selection. Another workaround is to use the triple click selection mode.

I've reproduced this with a fresh install of Debian testing ("stretch") with the GNOME desktop environment task enabled. The following package versions have the buggy behavior:

 - gnome-terminal 3.20.0-1
 - vte2.91 0.44.0-1

The following package versions have the expected behavior:

 - gnome-terminal 3.18.3-1
 - vte2.91 0.42.5-1

I built vte from git and found that tag 0.43.0 has the expected behavior while tag 0.44.0 has the buggy behavior. Bisecting between 0.43.0 and 0.44.0 found the following commit:

commit 3696348c0b9c7d60caf7302411ec4c0298f56e57
Author: Christian Persch <chpe@gnome.org>
Date:   Fri Dec 4 20:10:04 2015 +0100

    widget: Rework get_text()

    Ignore the passed VteSelectionFunc callback and just always use
    the whole passed range.
Comment 1 Robert Edmonds 2016-04-19 21:47:05 UTC
Created attachment 326361 [details]
Screen recording of expected behavior
Comment 2 Christian Persch 2016-04-19 21:47:46 UTC
I'll have a look.
Comment 3 Robert Edmonds 2016-04-19 21:48:28 UTC
Created attachment 326362 [details]
Screen recording of buggy behavior
Comment 4 Christian Persch 2016-04-19 21:52:35 UTC
(In reply to Robert Edmonds from comment #0)
> In the single click selection mode, the first line of a multi-line selection
> is replaced with a blank line when pasted. This is a regression from
> previous versions where the copied text would match the visible selection.

Hmm.. maybe I misunderstand the instructions to repro, but I cannot repro here (using vte-2.91 test app).
Comment 5 Robert Edmonds 2016-04-19 22:00:30 UTC
(In reply to Christian Persch from comment #4)
> (In reply to Robert Edmonds from comment #0)
> > In the single click selection mode, the first line of a multi-line selection
> > is replaced with a blank line when pasted. This is a regression from
> > previous versions where the copied text would match the visible selection.
> 
> Hmm.. maybe I misunderstand the instructions to repro, but I cannot repro
> here (using vte-2.91 test app).

Hi, Christian:

Did you have a look at the bad.webm screen recording?

The easiest way is probably to take a terminal with several lines of non-empty text and single click and drag upwards, so that several whole lines of text are selected. If I click and drag on the extreme right side of the terminal I get whole lines of text selected at a time, without selecting only parts of the first or last lines. The first line of the selection should have text in it.
Comment 6 Robert Edmonds 2016-04-19 22:09:59 UTC
(In reply to Robert Edmonds from comment #5)
> (In reply to Christian Persch from comment #4)
> > (In reply to Robert Edmonds from comment #0)
> > > In the single click selection mode, the first line of a multi-line selection
> > > is replaced with a blank line when pasted. This is a regression from
> > > previous versions where the copied text would match the visible selection.
> > 
> > Hmm.. maybe I misunderstand the instructions to repro, but I cannot repro
> > here (using vte-2.91 test app).
> 
> Hi, Christian:
> 
> Did you have a look at the bad.webm screen recording?
> 
> The easiest way is probably to take a terminal with several lines of
> non-empty text and single click and drag upwards, so that several whole
> lines of text are selected. If I click and drag on the extreme right side of
> the terminal I get whole lines of text selected at a time, without selecting
> only parts of the first or last lines. The first line of the selection
> should have text in it.

That is, it only occurs when the beginning of the selection extends to the leftmost column of the first line, but only when that selection was made *without* actually starting or ending the click-and-drag selection on the leftmost column of the first line. It also doesn't occur at all when the beginning of the selection starts in the middle of a line.
Comment 7 Egmont Koblinger 2016-04-20 03:31:05 UTC
Yup, confirmed.

(Didn't read the description thoroughly, just watched the screencast :))
Comment 8 Christian Persch 2016-04-20 16:51:21 UTC
Ok, can repro now, by starting the selection on the right after the last character on a line.
Comment 9 Christian Persch 2016-05-08 07:00:17 UTC
I pushed a fix for this to master and 0-44, please test.
Comment 10 Egmont Koblinger 2016-05-08 21:09:21 UTC
Looks okay so far, thanks!