Rather than with compact, the way to do this is to overload two methods of show. One with signature show(::IO, ::MyObject), which will apply for “compact printing” and another with signature show(::IO, ::MIME"text/plain", ::MyObject) which will apply to “display” printing like top level repl.
4 Likes