Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 457969

Summary: [console] Automatic scroll lock should unlock when user enters characters
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: DebugAssignee: Sarika Sinha <sarika.sinha>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, sarika.sinha
Version: 4.5   
Target Milestone: 4.5 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Markus Keller CLA 2015-01-20 12:32:43 EST
The Console view's automatic scroll lock should auto-unlock when the user enters characters.

Steps:
- execute an interactive command line application like the one below
- produce some output, and then scroll up to read the first line
- without scrolling down, start typing the next input line
=> Console view automatically scrolls down and reveals the input line (only seems to work after the 2nd character has been entered)
=> auto-lock is NOT released, and the next input line is not shown

package pack;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Interactive {
    public static void main(String[] args) {
        System.out.print("input> ");
        BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
        String line;
        try {
            while ((line= br.readLine()) != null) {
                for (int i= 0; i < 20; i++) {
                    System.out.println(i + ". You said: " + line);
                }
                System.out.print("input> ");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Comment 1 Dani Megert CLA 2015-04-08 03:52:38 EDT
Would be good to have this fixed for 4.5.
Comment 2 Sarika Sinha CLA 2015-04-08 09:22:19 EDT
What if it is a manual scroll lock?
Comment 3 Dani Megert CLA 2015-04-08 09:55:20 EDT
(In reply to Sarika Sinha from comment #2)
> What if it is a manual scroll lock?

This bug is just about unlocking after auto-lock. If the lock was done manually, then it should stay locked.
Comment 5 Dani Megert CLA 2015-04-15 06:47:10 EDT
(In reply to Sarika Sinha from comment #4)
> Resolved via
> http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=d8ab8f362c6572602b90c79635cb77a113b64d0c
> 

This breaks the auto lock/unlock behavior:
1. when locked I can't unlock anymore via scroll down
2. state is not correctly preserved to new console/launch

Reverted with http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=213c098cb78bf40881628dcdaf345b3898070ba8
Comment 6 Sarika Sinha CLA 2015-04-15 06:59:36 EDT
(In reply to Dani Megert from comment #5)
It retains the user selection. It ignores the auto lock which code did. 
It does unlock when going down if it was auto lock, it does not aut unlock on going down if user did the manual lock. 

I did these changes knowingly, as people may not want it to get auto unlocked like we said in Bug 464602 also.
Comment 7 Dani Megert CLA 2015-04-15 07:17:18 EDT
(In reply to Sarika Sinha from comment #6)
> (In reply to Dani Megert from comment #5)
> It retains the user selection. It ignores the auto lock which code did. 
> It does unlock when going down if it was auto lock, it does not aut unlock
> on going down if user did the manual lock. 
> 
> I did these changes knowingly, as people may not want it to get auto
> unlocked like we said in Bug 464602 also.

This is not exactly the same here, and this bug is only about typing but your fix affects other scenarios too, which is wrong.
Comment 8 Sarika Sinha CLA 2015-04-15 07:50:58 EDT
Updated the solution to preserve the previous behavior.

This patch only unlocks the auto lock if user starts typing and there was no manual lock set.

http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=3c608ddde09bcae80783e2d93917117c0a7117c3
Comment 9 Sarika Sinha CLA 2015-04-27 00:10:56 EDT
Verified using
Eclipse SDK

Version: Mars (4.5)
Build id: I20150426-2000