This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 17337 - CTRL-C to copy in Output Window causes it to scroll to bottom
Summary: CTRL-C to copy in Output Window causes it to scroll to bottom
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Terminalemulator (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: ivan
URL:
Keywords:
: 21035 21207 26285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-11-06 10:56 UTC by _ tboudreau
Modified: 2008-12-23 08:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2001-11-06 10:56:44 UTC
Select some content in the output window, with it scrolled back from the bottom.
Press CTRL-C to copy it to the clipboard.  The output window scrolls to the
bottom.

This is desirable behavior in a terminal on user input, and indeed is the
default behavior of XTerm.  However, in the case of meta-actions which are not
intended to be providing input, this needs to be suppressed (does the OW
actually need to be sensitive to user input at all when it's displaying program
output or compilation results?)
Comment 1 akemr 2001-11-06 12:09:10 UTC
I don't see this behaviour in compiler OW or when OW displays output 
only. Please attach example, if you have another opinion.

But when executed program uses input (opens input stream), then it 
should be sensitive on user input IMO.
Comment 2 Lukas Hasik 2001-11-07 16:43:08 UTC
Yes, it works fine for output only. 
When I do System.out.println("....")  OW changes to I/O mode and
CTRL+C works properly but a square character is displayed. Why is the
OW in I/O when I'm doing only output ? Or am I wrong ?
Comment 3 _ tboudreau 2001-11-07 17:32:13 UTC
I encountered this when testing an app that I set up to write
voluminous debug output and needed to copy a portion of it into the
unit tests that would need to match this output in the future.  I did
also see the square characters appear for my CTRL-C keystrokes.

I think it's worth differentiating meta keystrokes, or at least doing
this optionally in the output window - the two things it's likely to
be used for are:
  Java - Copy to the clipboard
  C - Brutally terminate the program

in neither case is scrolling the window useful.  As long as we do send
those keystrokes to the application's standard in as well, everything
works as expected in all cases.  
Comment 4 akemr 2001-11-08 10:39:36 UTC
I think I should reassign it to Ivan..
Comment 5 Jan Chalupa 2001-11-27 11:50:48 UTC
Target milestone -> 3.3.1.
Comment 6 Jan Chalupa 2001-11-27 11:54:22 UTC
Target milestone -> 3.3.1.
Comment 7 Jan Chalupa 2002-01-11 14:04:17 UTC
Target milestone -> 3.4
Comment 8 Jan Chalupa 2002-01-11 14:08:14 UTC
Target milestone -> 3.4
Comment 9 Jan Chalupa 2002-01-11 14:09:11 UTC
Target milestone -> 3.4
Comment 10 Jan Chalupa 2002-01-11 14:11:49 UTC
Target milestone -> 3.4
Comment 11 akemr 2002-03-04 15:10:45 UTC
*** Issue 21035 has been marked as a duplicate of this issue. ***
Comment 12 Marek Grummich 2002-07-22 08:50:32 UTC
Target milestone was changed from '3.4' to TBD.
Comment 13 Marek Grummich 2002-07-22 09:03:29 UTC
Target milestone was changed from '3.4' to TBD.
Comment 14 Marek Grummich 2002-07-22 09:07:58 UTC
Target milestone was changed from '3.4' to TBD.
Comment 15 Marek Grummich 2002-07-22 09:15:13 UTC
Set terget milestone to TBD
Comment 16 Marek Grummich 2002-07-22 09:15:41 UTC
Target milestone was changed from '3.4' to TBD.
Comment 17 Marek Grummich 2002-07-22 09:17:01 UTC
Target milestone was changed from '3.4' to TBD.
Comment 18 Marek Grummich 2002-07-22 09:18:09 UTC
Set terget milestone to TBD
Comment 19 Marek Grummich 2002-07-22 09:22:35 UTC
Target milestone was changed from '3.4' to TBD.
Comment 20 akemr 2002-08-09 13:56:42 UTC
*** Issue 26285 has been marked as a duplicate of this issue. ***
Comment 21 _ ttran 2003-02-28 08:26:47 UTC
doesn't seem we can fix it for 3.5 -> target = 4.0
Comment 22 ivan 2003-03-27 02:54:18 UTC
*** Issue 21207 has been marked as a duplicate of this issue. ***
Comment 23 ivan 2003-12-03 01:30:02 UTC
If someone types a ^C to Term (under stock NB) currently the copy
action may happen but you also get a square printed and may get
other side-effects per this bug report.

Term has a mechanism where the keystrokes for all actions associated
with 
it's containing window can be used to defeat their printing (as
squares).
(See Term.setKeyStrokeSet()).

There is an issue that the registered KSS is in terms of KeyStrokes
made up
of KeyCodes, while Term needs to filter out Key_Char_s. I've
dealt with his as best as I can but when testing discovered
that the set of Kestrokes registered with Term is not quite right.

This is done in OutputTabTerm.updateKeyStrokeSet() where it
uses lookup to get _some_ keymap. When I dump it it's a pretty
large keymap. It contains keystrokes not relevant to OW
and is missing keystrokes like Ctrl-A.
So are we registering the correct keymap?
Comment 24 ivan 2003-12-17 00:03:44 UTC
'keystroke_set' is a collection of KeyStrokes in the form:
        ks3 = getKeyStroke(VK_C, CTRL_MASK)
we use Term.maybeConsume() in keyPressed and keyTyped events. During
keyTyped the event->KS mapping gives us
        ks2 = getKeyStroke((char) ('c'-64), CTRL_MASK)
ks2 and ks3 while logically equivalent don't hash to the same so
maybeConsume() says yes to ks2 and the Ctrl-C gets passed on.

So to detect whether something in 'keystroke_set' needs to be dropped
we need to check at keyPress time but take action at keyTyped time.
'passOn' helps us do that.
Comment 25 Marian Mirilovic 2005-07-13 13:24:57 UTC
closed
Comment 26 Quality Engineering 2008-12-23 08:23:59 UTC
moving terminal emulator issues to terminalemulator component.
To see the correct version and target milestone of this issue look at Issue
Activity table.