Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut key to clear console in Eclipse

What is the shortcut key to clear console in Eclipse or how can it be configured? Any work-arounds to achieve this?

like image 592
Gaurav Avatar asked Nov 04 '09 08:11

Gaurav


People also ask

How do I clear the console in Eclipse?

out. print(ESC + "2J"); Also, you can print multiple end of lines ("\n") and simulate the clear screen.

What is the shortcut for clearing console?

Use the short cut Ctrl + L to clear the console.

What is Ctrl Shift R in Eclipse?

File Navigation – Eclipse Shortcuts CTRL SHIFT R – Open a resource. You need not know the path and just part of the file name is enough. CTRL E – Open a file (editor) from within the list of all open files. CTRL PAGE UP or PAGE DOWN – Navigate to previous or next file from within the list of all open files.

How do I view the console log in Eclipse?

It can be changed by going to Windows --> Preferences --> Run/Debug --> Console and then unchecking "Limit Console Output" which is ON by default. This works on STS any version too. This would help printing complete console output. For a Mac it is Eclipse > Preferences > Run/Debug > Console.


6 Answers

I know this thread is already 3 years old, but if someone is still looking for it, in Indigo the shortcut is Shift - F10 followed by r.

Cheers.

like image 137
José Alfredo Romero L. Avatar answered Oct 05 '22 22:10

José Alfredo Romero L.


It does not appear to be a way, as there's a bug filled regarding this issue on bugs.eclipse.org.

like image 26
luvieere Avatar answered Oct 05 '22 22:10

luvieere


I found a solution for the wiping the console in an Eclipse IDE. It uses the Robot class. Please see code below and caption for explanation:

   import java.awt.AWTException;
   import java.awt.Robot;
   import java.awt.event.KeyEvent;

   public void wipeConsole() throws AWTException{
        Robot robbie = new Robot();
        //shows the Console View
        robbie.keyPress(KeyEvent.VK_ALT);
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_Q);
        robbie.keyRelease(KeyEvent.VK_ALT);
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_Q);
        robbie.keyPress(KeyEvent.VK_C);
        robbie.keyRelease(KeyEvent.VK_C);

        //clears the console
        robbie.keyPress(KeyEvent.VK_SHIFT);
        robbie.keyPress(KeyEvent.VK_F10);
        robbie.keyRelease(KeyEvent.VK_SHIFT);
        robbie.keyRelease(KeyEvent.VK_F10);
        robbie.keyPress(KeyEvent.VK_R);
        robbie.keyRelease(KeyEvent.VK_R);
    }

Assuming you haven't changed the default hot key settings in Eclipse and import those java classes, this should work.

like image 27
sbanders Avatar answered Oct 05 '22 23:10

sbanders


This thread is 7 years old now, but I constantly need to clean the console so i can get work done. Thanks to sbanders I made this AutoHotKey script:

#`::
WinGetTitle, Title, ahk_class SWT_Window0
if InStr(Title, "Eclipse") {
  WinActivate, ahk_class SWT_Window0
  Send +!q
  Sleep, 1200
  Send c
  Send +{F10}r
}
return 

What this means is the following.

  • When the user presses WinKey + Backtic (this can easily be changed to a different hotkey),
  • If an Eclipse window exists
  • Activate that window and press CTRL + SHIFT + q (opens navigation context menu)
  • Wait 1.2 seconds (wait time probably depends on system specs)
  • Press c (Will focus on console view)
  • Press SHIFT + F10 + r (Clears console)
  • End script

It's a very handy script for coders who don't like clicking so I thought I'd share it.

like image 26
Andrew Avatar answered Oct 05 '22 23:10

Andrew


Press Shift + Alt + Q followed by C to set focus to console.

Then press Shift+F10 followed by R to clear it.

like image 30
Christian Marchiori Avatar answered Oct 05 '22 23:10

Christian Marchiori


When I right-click inside the console window and select 'clear' it clears my console. I'm using Windows 10.

If you press Shift+F10+r that works.

like image 38
bethm Avatar answered Oct 05 '22 21:10

bethm