0

I'm working on a program using the CLion IDE, and am running it using the IDE's Run or Debug actions. The program's standard output and error streams are directed to an embedded 'Run' console, typically at the bottom of the CLion Window.

Unfortunately, my program is producing a lot junk messages on stdout, coming from certain libraries I'm using (i.e. I can't turn it off easily in the source code).

If I were running my program outside CLion, I would simply pipe the output stream and/or the error stream through some grep filter (perhaps using stdbuf). But - can I do something like that in CLion? i.e. apply a filter to the Console output? No right-click menu or button on or around the Run console seems to allow for that.

1 Answer 1

0

CLion doesn't offer filtering functionality per se, but it does offer something very close: Line "folding".

If you navigate through the menus to File > Settings > Editor > Console , you'll see a box entitled "Fold console lines that contain:" - and that's the place to add patterns to match for filtering lines.

What you'll actually see is these lines replaced by a differently-colored message on the previous console line before any filtered line, saying, for example <12 internal lines> - meaning 12 lines matched the patterns and are not shown. If you click that area, the lines will be "unfolded" and appear as they had come out on the output stream. You can even 'refold' the unfolded lines - there's a [-] box you can toggle.

(This answer is based on CLion 2025.2, I'm not sure how far back this folding goes, but I'm guessing that quite far.)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.