Bug 219589

Summary: [terminal] "Copy" is disabled when an entire line is selected
Product: [Tools] Target Management Reporter: Martin Oberhuber <mober.at+eclipse>
Component: TerminalAssignee: Martin Oberhuber <mober.at+eclipse>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, creynaud, eclipse, wb-rel
Version: 3.0Keywords: bugday, helpwanted
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 323166    
Attachments:
Description Flags
Copy disabled in the context though selection is not empty
none
Mouse released out of the Terminal view
none
Proposed fix
none
Proposed fix #2 mober.at+eclipse: iplog+

Description Martin Oberhuber CLA 2008-02-20 08:43:13 EST
SSH Terminal into some remote machine. Issue this command:

mober@localhost> echo "hallo"
hallo
mober@localhost>

Drag the selection from "mober@" until the end of the line, right-click
--> Copy is enabled in the context menu.
Drag the selection down to the "h", right-click
--> Copy is enabled in the context menu.
Drag the selection such that it ends just before the "h", right-click
--> Copy is disabled in the context menu.

Expected result is that Copy should be enabled, and the entire first line including line-end separators (\n) should be copied into the copy buffer.

-----------Enter bugs above this line-----------
TM 3.0M5
installation : eclipse-SDK-3.4M5 (I20080207-1530), cdt-4.0.0M5, emf-2.4.0M5
     DSF-N20071113, ECF-2.0m5, PHPEclipse-1.2.0.20080208, Releng.Tools-3.4M5,
     Subversive-0.7.0.v20080214, SWT-MemMonitor, WR-Retriever-3.0.v20070604,
     Mylyn-2.3.0.I20080214-1500, RXTX-2.1-7r3b, J9Launching
RSE install  : RSE-SDK-I20080215-1245, TM-terminal, TM-discovery
java.runtime : Sun 1.6.0_02-b06 -Xmx512m -XX:MaxPermSize=128m
os.name:     : Windows XP 5.1, Service Pack 2
------------------------------------------------
systemtype   : Windows-local, Dstore-win, Dstore-linux
targetos     : Red Hat Enterprise Linux WS release 4 (Nahant Update 3)
targetuname  : Linux parser 2.6.9-34.EL #1 i686 athlon i386 GNU/Linux
targetvm     : Sun Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode)
------------------------------------------------
Comment 1 Martin Oberhuber CLA 2008-03-03 12:34:04 EST
Although there is an easy workaround, I find this annoying and confusing. Might be a really nice bugday bug for somebody to step up and fix.
Comment 2 Claire Reynaud CLA 2009-09-07 11:58:08 EDT
Created attachment 146616 [details]
Copy disabled in the context though selection is not empty
Comment 3 Claire Reynaud CLA 2009-09-07 11:59:37 EDT
"Copy" is also disabled in the context menu when user drags the selection from the end of the line to the start of the line and releases the mouse button out of the Terminal view text canvas. See attached screenshots.
Comment 4 Claire Reynaud CLA 2009-09-07 12:00:45 EDT
Created attachment 146617 [details]
Mouse released out of the Terminal view
Comment 5 Claire Reynaud CLA 2009-09-07 12:22:04 EDT
Forgot to add some information about my configuration, so here it is:

Eclipse Version: 3.5.0
Build id: I20090611-1540

Target Management Terminal Widget
Version: 3.0.0.v200905272300-4--7w311A16383411
Build id: 3.1 (20090617-1400)

Debian Linux
Comment 6 Martin Oberhuber CLA 2009-11-26 05:21:42 EST
CQ:WIND00192310
Comment 7 Anton Leherbauer CLA 2010-07-08 03:41:57 EDT
Created attachment 173743 [details]
Proposed fix

When dragging outside the widget, the selection bounds become negative which is treated as "no selection" in AbstractTextCanvasModel.
This patch makes sure the drag end coordinates are non-negative when setting the selection bounds.
Comment 8 Martin Oberhuber CLA 2010-07-08 09:17:16 EDT
Hm... as explained in comment 0, I have seen the issue also when dragging _inside_ the widget but down 1 line. Is that case addressed as well?
Comment 9 Anton Leherbauer CLA 2010-07-09 03:55:49 EDT
(In reply to comment #8)
> Hm... as explained in comment 0, I have seen the issue also when dragging
> _inside_ the widget but down 1 line. Is that case addressed as well?

Yes it is, because you need to drag outside the widget to select only the line without the first character of the following line ('h').
But I just found out that the patch makes it impossible to not select the 'h' in this case...
Comment 10 Anton Leherbauer CLA 2010-07-09 04:47:27 EDT
Created attachment 173839 [details]
Proposed fix #2

This patch makes sure the selection start coordinates are non-negative and fixes the handling of negative end column in AbstractTextCanvasModel.
Comment 11 Anton Leherbauer CLA 2010-08-17 10:17:10 EDT
ping?
Comment 12 Martin Oberhuber CLA 2010-08-19 10:22:07 EDT
Released to 3.2.1 Stream.
Comment 13 Martin Oberhuber CLA 2010-09-21 08:50:42 EDT
Comment on attachment 173839 [details]
Proposed fix #2

Forgot adding the iplog+ flag for this.