Completely clear the console in RubyMine (or WebStorm or PhpStorm)
Asked Answered
B

2

13

I am trying to see if there is a way to "completely" clear the console in RubyMine (or any other JetBrains IDE like WebStorm or PhpStorm).

I've seen an answer for this question: RubyMine any way to clear the inbuilt console.

Unfortunately, that doesn't really clear the console, it just moves the console window so that the current line is at the top of the screen. Pretty much like "clear" does in Linux.

Sometimes, I run a command that has a lot of information display in the console and I want to see the first thing that it said, but when the console clears this way, I find that I can lose where I stated the command within all the junk that gets printed before and afterwards.

I would prefer something like reset in Linux or cls in Windows that actually clears the console, but these seem to have the same effect as clear when I'm in RubyMine

So far, the only thing I've found to do is hit the "plus" on the left side and open a new console window, but I find that a bit tedious.

I'm using this in Ubuntu, if that makes a difference, but I believe I've experienced the same issues in Windows as well.

Belier answered 15/4, 2015 at 13:47 Comment(2)
It may be OS specific, since cls on my Windows version of PhpStorm (build #PS-139.1348) clears the terminal window just fine. Perhaps raising a ticket in their issue tracker might help to get this to the Linux version of RubyMine as well.Suffuse
@Oldskool: On WebStorm 2023.1, cls just scrolls the input prompt to the top even on Windows :/Unbridled
H
35

Right click and select Clear buffer or just press Ctrl + K when the console is focused.

Hagiography answered 15/4, 2015 at 15:4 Comment(3)
For those of us who are mac users, it's Cmd + K.Penknife
On WebStorm 2019.3.3 Clear buffer is assigned to Ctrl + L.Yetah
On WebStorm 2023.1, the "Clear buffer" command in the context menu appears to always remain disabled. Ctrl + K does nothing beside writing ^K into the terminal. And Ctrl + L, as suggested by @Yetah , does exactly what is highlighted as problematic in the question, it scrolls the input prompt line to the top and thereby just hides the preceding content (until I scroll up again), but clears/deletes nothing.Unbridled
G
1

For those having the issue with the newer versions of WebStorm (the "Clear Buffer" option being disabled from the context menu) there's a relatively easy solution. You need to update the IDE registry, namely:

  1. Ctrl+Alt+Shift+/
  2. Select Registry
  3. Find the option terminal.use.conpty.on.windows
  4. Uncheck it/set it to false
  5. Restart WebStorm

I'm pretty sure the majority of people approaching this thread actually have the issue I've mentioned, and not the original one from the question.

How to clear terminal buffer in IntelliJ 2023.1?

More context here: https://youtrack.jetbrains.com/issue/IJPL-101409/Windows-Clear-buffer-option-is-disabled

Germanous answered 6/6 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.