Console folding customization

Once I wrote about console folding for Groovy stacktraces. Naturally, many people wished similar things could work for other languages and frameworks. Long story short, there’s now a settings page dedicated to the console folding. It provides a settings page where you may specify which console lines to fold:

This functionality is available in IDEA 9.0.2 via Console Folding plugin. In IDEA X, it will be bundled. Furthermore, there will be a nice addition to these settings: an action that allows you to add folding rules very easily right from the console. Just select the fragment which will toggle the folding of the lines containing it, and right-click:

Comments below can no longer be edited.

12 Responses to Console folding customization

  1. Avatar

    Jason Dias says:

    July 12, 2010

    Can you add an option to just omit the lines?

  2. Avatar

    Randall R Schulz says:

    July 12, 2010

    Can this be used to suppress the many repetitions in a stack overflow exceptions caused by unbounded or excessive recursion?

  3. Avatar

    Peter Gromov says:

    July 13, 2010

    Jason, just omitting the lines is not possible at the moment, and I suppose that would be misleading. Actually the folded stack traces look almost as if the lines were omitted, there’s just something gray saying ‘n internal calls’ on the right.

    Randall, this can make the repetitions shorter and easier to recognize, that’s it. No suppression yet, and I can’t imagine how that would look like.

  4. Avatar

    Cameron Beccario says:

    July 22, 2010

    I’m running IDEA 9.0.2 without the Console Folding plugin installed. And yet, stack trace lines under sun.reflect.* and java.reflect.* are being folded in the Run console. Is it possible to turn this off? A search in settings for “console folding” pointed only to “Colors & Fonts”.

  5. Avatar

    Peter Gromov says:

    July 23, 2010


    Unfortunately, no. In IDEA 9 the only way to turn off console folding is to disable the Console Folding plugin.

  6. Avatar

    Cameron Beccario says:

    July 27, 2010

    Hi Peter:
    Thanks for the reply!
    I cannot disable the plugin because I do not have it installed; it is not listed under the Settings->Plugins->Installed tab. And yet, IDEA 9 is still folding sun.reflect.* and java.reflect.*.

  7. Avatar

    Peter Gromov says:

    July 28, 2010


    I see, sorry for misreading you. There’s really no possibility to turn this off in 9 on user level. But, if you want it very-very-very much, you can go to lib/resources.jar/META-INF/IdeaPlugin.xml and comment out the following line:

    <stackFrameFilter implementation=”com.intellij.execution.filters.ReflectionStackFrameFilter”/>

  8. Avatar

    Arnon says:

    August 2, 2010

    I tried to use the plugin to fold text that is not exceptions/stack traces, but it seemed to have no effect (Idea 9.03).
    I use EasyB and I want to fold all lines that have no failures (containing “, Failures: 0,”)
    I tried to use various patterns in the plugin to no effect…


  9. Avatar

    Peter Gromov says:

    August 3, 2010

    Arnon, this should work. Character case may not match. Maybe there are several whitespaces where you have one, or vice versa. They may also use a tab character.

  10. Avatar

    Saravana says:

    September 25, 2018

    Is this possible to write a plugin to do the same in the Embedded Terminal instead of the Console?

  11. Avatar

    Srirama says:

    February 1, 2019

    Does it possible to add Show as json with folding options enabled?

  12. Avatar

    Srirama says:

    February 1, 2019

    Does it possible to add Show as json with folding options for standard JSON folding options?

Discover more