Suppressing text output of display() of Makie

When I create a figure and display it with Makie like the following code:

using CairoMakie
fig = Figure()
...
display(fig)

I get a long list of text outputs like this:

Scene (800px, 600px):
  108 Plots:
    ├ Combined{Makie.poly, Tuple{Vector{Vector{Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
...

Is there a way to suppress this text output? I have other text outputs that summarize the results of calculation, and having to scrolling up to see those results is a nuisance.

Why do you need display(fig) with CairoMakie? What are you expecting to get? Is this on the REPL or on some other environment like jupyter?

If it is in jupyter/vscode and your purpose is to show the output image, you don’t need to do display(fig), fig alone will suffice. If you want to suppress the output of fig you can add a semicolon, like fig;.

If this is in the REPL, CairoMakie cannot launch a window by itself, only save to disk.

I am using Atom/Juno IDE. AFAIK, we cannot open multiple windows for separate plots in Makie yet; see this issue. However, in Atom/Juno you can actually do this; separate plot panes are created whenever you call display(fig). Showing different plots in separate panes is very convenient. The only downside is that display(fig) generates many many lines of text output as described above.

Simply calling fig or fig; does not create separate plot panes in Atom/Juno.

This sounds like a bug: display is supposed to use only the “topmost applicable display in the display stack” and here it’s using two displays…

I don’t think it is a bug. I think it is a feature of Atom/Juno. Whenever display(...) is called, a plot is drawn in the same window. However, Atom/Juno caches the previous plots, so I can browse through all the plots generated by display(...).

Makie is doing something weird here because it overrides display and not just show, which is not the recommended usage and may compose poorly with environments using custom displays.