'How to shorten the first line in the Intellij console?

I want my first line at the top of the console to look like this: enter image description here

, but mine looks like this, and it's long: enter image description here

How can I shorten it to like the first picture?

I'm watching Java tutorials on youtube and their first lines ("C:\programs Files\Java\jdk\whatever"...) are always so short and pretty with 3 cute dots in the end, but mine is long and annoying.



Solution 1:[1]

You can define the lines which should be folded:

  1. Right click on that line in the console
  2. Choose "Fold Lines Like This"
  3. Click OK

You can also define special keywords/phrases in this menu, where lines, which contains the phrase will be folded with ellipsis (...) at the end.

Solution 2:[2]

See the ConsoleViewImpl.java file in the source code of IntelliJ IDEA

This line (execution command) will be automatically hidden in case the string length is more than 1000 symbols.

So, once you add something to the execution command (for example by adding libraries), the execution command is folded automatically.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 csalmhof
Solution 2 Konstantin Annikov